Report this

What is the reason for this report?

SCP from Windows destroys SSH connections

Posted on November 27, 2023

Hi, I’m trying to write a publish script that copies a bunch of files over from a Windows machine to a Linux droplet (Ubuntu). I can successfully SSH into the remote Linux machine and can also run small (single file) scp commands to copy files over.

When I run a recursive copy scp.exe -r [source dir] [remote dir] of a few megabytes, all SSH connections into my droplet stall. Eventually the original scp command times out with the error message:

ssh: connect to host IPADDRESS port 22: Connection timed out

I’m unable to reconnect to the droplet over ssh for about 5 minutes.

Some things I’ve noticed and tried:

  • Websites running on the droplet continue to be accessible during the freeze, so the droplet is still alive,.
  • I’ve tried changing the MTU on the remote droplet and it didn’t make a discernible difference.
  • I tried to look at the ssh logs on the remote server and noticed that the scp commands create connections to the server, but never close them. When I issue an ssh command, these connections are closed after use.
  • I have adjusted the MaxSessions and MaxStartups number in the /etc/ssh../sshd_config file (and restarted using sudo systemctl restart ssh.service)

Anyone know anything else i can try?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.