简体   繁体   中英

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

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.

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

I ran into the same issue on one of my Redat 8 box's after I rebuilt the server

I ran scp -v and noticed that 'Sink:' was showing a status message that I had added (echo "...") to my .bashrc file

Once I removed the echo statement scp ran without an issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM