Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

protocol error: mtime.sec not present when tried to transfer folder/file from remote server to local

I am using Ubuntu 20 on alicloud and I have an issue when trying to copy from sftp remote server to local using cl:

scp -r -P 22 sftpibas@localhost:/sftpibas dev

but it raised

protocol error: mtime.sec not present

If you want to look into my config here I attach my sshd_config:

Include /etc/ssh/sshd_config.d/*.conf

PermitRootLogin yes

ChallengeResponseAuthentication no

UsePAM yes

PrintMotd no

AcceptEnv LANG LC_*

Subsystem       sftp    /usr/lib/openssh/sftp-server

Match group sftp
ChrootDirectory /home
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

Is my method to copy the files from the remote server to local wrong? Any suggestions are welcome

like image 787
ebuzz168 Avatar asked Oct 10 '20 08:10

ebuzz168


2 Answers

I tried to run scp -v. That gave me a bit more information:

Sink: This service allows sftp connections only.
protocol error: mtime.sec not present

And I try it with sftp it works.

like image 186
ebuzz168 Avatar answered Sep 23 '22 20:09

ebuzz168


The sshd_config is forcing connections to sftp, and the (oblique) error is the result.

Remove this line then reload/restart sshd:

ForceCommand internal-sftp
like image 39
Miles Gillham Avatar answered Sep 22 '22 20:09

Miles Gillham