# Scp/Sftp stalls

## Pyrates

Hi!

I seem to be unable to copy files via scp (or sftp) to a remote host, at least if they are somewhat large. The upload starts with unreasonably high throughput (claims 2.2 Mbit, I don't have that much), but then the numbers decline and end up in the dreaded "-stalled-". I even seem not to be able to to copy and paste via ssh, but I didn't test that much (I encountered it when I tried to c&p the scp session into the file on my server I'll link below).

So what info can I provide additinoally? My emerge-info, and here is  the output of the scp command (using -vvv; I tried doing some formatting to make the end more readable, hope I didn't make it harder). I killed the scp externally btw, and I had to kill the corresponding ssh via kill -9, but I'm not sure if that really was neccessary or if I was just to fast about it.

I recently started using a new kernel, you could find the config here. Maybe there's anything in there that makes this? From googling I found out to try "sysctl net.ipv4.tcp_sack=0", which I did, but to no avail.

I'd be really grateful for any pointers, I have  absolutely no idea how to go on about this.

----------

## davascript

You should use rsync.

```
rsync -avHS --progress /src/path user@host:/dest/path
```

----------

## Hu

What is your network topology like?  If you temporarily switch back to the old kernel, does the problem go away?  What are the versions of the affected and non-affected kernels?

----------

## Pyrates

I tried rsync, but afaik it works over ssh as well, and it stalled indeed as well.

But you know what? It's working again. Yesterday I fired up wireshark to see what happens when it stalls, but then it ran through, and today I could scp a large file, too (no wireshark today).

So thanks a lot for trying to help  :Smile:  It's sorta annoying to not know what happened, but as long as it's working, it's hard to diagnose, right? Kernels were both 2.6.31 btw, but with vastly different configs (old one stopped working due to sata problems, and I needed to make a new one).

----------

