8

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

ebuzz168
  • 1,134
  • 2
  • 17
  • 39

4 Answers4

10

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.

ebuzz168
  • 1,134
  • 2
  • 17
  • 39
2

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

Anthony
  • 21
  • 1
1

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
Miles Gillham
  • 284
  • 1
  • 11
0

I got this error and after adding -v to the scp command I learned that the error was caused by too many logins by my account to the remote box.

scp -v example.com:/tmp/example .
debug1: Sending command: scp -v -f /tmp/example
Sink: Too many logins for 'user1'
protocol error: mtime.sec not present
PatS
  • 8,833
  • 12
  • 57
  • 100