Why does scp get stalled? How do I resolve it?
This happens because scp
is trying to grab as much bandwidth as possible, and any delay (by a firewall, etc.) can stall it. Limiting the bandwidth (with -l option) will fix it.
For example, you might want to limit the bandwidth to 1 MB/s (= 8192 Kbits/s):
scp -l 8192 <file> <destination>
Source: http://www.aixmind.com/?p=1371 - Wayback Machine
I've managed to solve it by using rsync:
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /tmp/bigfile.txt [email protected]:/tmp/