Keep Your SSH Sessions Alive in Ubuntu

Add 3 lines below in /etc/ssh/ssh_config

TCPKeepAlive yes KeepAlive yes ServerAliveInterval 30

Warning! You might experienced 'Connection to 217.133.134.26 timed out while waiting to read' if the ServerAliveInterval is too short. I got that when I was connecting to remote server in US while my ServerAliveInterval was 5.

Refs:

- http://www.jorgepablos.com/2010/05/keep-your-ssh-sessions-alive-in-ubuntu/ << settings

- http://ubuntuforums.org/showthread.php?p=9880179#post9880179 << fix Connection to 217.133.134.26 timed out while waiting to read