I'm try to transfer a large (1GB+) file from one machine to another, but I have to tunnel through a gateway in between. I'm able to transfer small files just fine. However, with the big file, the transfer stalls mid-way through.

After reading a blog post on the stalling scp transfers, I tried using -l 8192 and even tried lowering it to -l 2000, but that just seemed to make it stall sooner:

scp -l 2000 -v -P 2222 username@localhost:/path/to/file.gz .

From the verbose output (-v) of the scp command, it look like the -l isn't getting passed on…

debug1: Sending command: scp -v -f -- /path/to/file.gz

Any other ideas?

  • -l shouldn't be passed on. It's a local option. – David Schwartz Oct 7 '11 at 22:32

An ugly work around would be to use rsync instead of scp. The rsync program can reliably resume interrupted transfers. If it hangs, just break out with CTRL-C and repeat the command.


I think you should use rsync in a screen session. An interrupt can be re-run with --ignore-existing option.


I don't think rsync is an ugly work around. Be sure to use the -c flag rsync, that way it can pick up where it left off if the connection gets interupted, also include the --verbose to see more info during the transfer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.