RSync over SSH hangs and fails with timeout

Solution 1:

First I would try turning up verbosity of the ssh transport:

rsync -av -e "ssh -vv" /src user@host/dest

Second, it might be hanging on a file or filesystem on the remote side. Can you ssh into the remote and attempt to tar up the same targets?

Solution 2:

One approach would be to have tcpdump

tcpdump port 22 and host <IP>

and strace

strace -f -o xxx -p <PID of the rsync process>

running on both sides. When the timeout occurs, you should be able to see irregular things in at least the output of tcpdump.

With the new information being available then, you should be able to chase down the source of the problem.

In addition, run traceroute or mtr on both machines in order to check if the route/connection between them is healthy.