Autossh

Detects when SSH connections drop and auto-reconnects.

Basic Instructions
These are available at the autossh website and its README file:
 * http://www.harding.motd.ca/autossh/
 * http://www.harding.motd.ca/autossh/README

Important Tips
The "-M" option is required, even if you don't want to use the monitoring option (in which case, use "-M 0").

When using "-M"...
 * Connections are tunnelled. No firewall changes needed for autossh's monitoring feature.
 * Ports need to be above 1024 if you are not logging in as root.
 * If you use a password prompt, then autossh will wait for your password when it reconnects, and it won't be fully connected until you give that password. So, it's helpful to use a key (instead of password) and ssh-agent.

Examples

 * 1) Simple login example

SSH on port 222. Setup a SOCKS proxy on port 9999. Using "ServerAliveInterval" and "ServerAliveCountMax" as recommended in the autossh README file.
 * 2) More Complex Example


 * 3) Use autossh with sshfs