To keep connections alive (to all hosts), add the following to the .ssh/config file:
Host * ServerAliveInterval 60