# rsync dying after a few MBs [SOLVED]

## rsa4046

After using rsync for many months to move files back and forth between two gentoo boxes (I'll call them home and work), ssh and rsync now have issues, apparently coincident with installing ssh-agent and denyhosts (on the remote box). When I try to push files from local to remote, after a few minutes the remote server apparently cuts the connection:

```
Read from remote host myremotehost.work.com: Connection reset by peer

rsync: writefd_unbuffered failed to write 4 bytes [sender]: Broken pipe (32)

rsync: connection unexpectedly closed (99 bytes received so far) [sender]

rsync error: unexplained error (code 255) at io.c(635) [sender=3.0.2]
```

When this happens, the work machine also breaks the connection in any other ssh sessions with the local box:

```
Read from remote host myremotehost.work.com: Connection reset by peer
```

I am pretty positive this issue exists solely in the interaction between the remote server and the local box, as I can rsync all day between the local box and other remote machines (located on the same remote work network), and between other hosts at home (e.g., a laptop) and the remote work server (all of course using the same ADSL network connection).

Whatever is causing this is new, as ssh/rsync worked flawlessly before ssh-agent + denyhosts. However, stopping the denyhosts daemon on the remote server does not solve the problem. Can anyone suggest a means of tracking this down?  Again, nothing has been changed in the sshd_config on the server, and this only happens during rsync (i.e., I can keep ssh sessions between the two machines going forever as long as I don't try to move files via rsync. If I establish a vpn connection (different server at my work network), such that all traffic from the local machine goes over the vpn connection, then all files move fine with no breaks in connection. Any ideas would be welcome.Last edited by rsa4046 on Fri Dec 19, 2008 8:13 pm; edited 1 time in total

----------

## rsa4046

Finally figured this out, so thought I'd close this orphaned post. The problem was no provision for timeouts (apparently rsync defaults to  --timeout=0). Eliminating forwarding and setting a generous timeout solved this issue for me:

```

$ rsync -auv -e 'ssh -ax -c blowfish' --timeout=3600 sourcepath targetpath ...
```

Hope this helps someone else with a busy IP connection.

----------

