Posts

Showing posts from October, 2010

SSH Client Keep Alives

At my new office in the  Shell Building  the main router is a SonicWal l which has a setting to drop idle TCP connections after 15 minutes. This is annoying since I usually have several going at once. I don't have access to the router so I had to work around the issue. The poor man's solution is to run the "top" command on your idle terminals so that packets come through. Not elegant and too manual for me. The rich man's solution is to change the server's keep alive settings (TCPKeepAlive yes). I call this the rich man's solution because it means every one bends over for you. The middle class man's solution is to add some directives to the default SSH client options on your local machine. Here's how: Edit ( as root) /etc/ssh/ssh_config and add the following lines: TCPKeepAlive yes ServerAliveInterval  60 ServerAliveCountMax 5 This means that every 60 seconds your machine will send a keep alive to the server if there is no other acti