[Cialug] ssh ServerAlive options

David Champion cialug@cialug.org
Thu, 26 May 2005 15:03:38 -0500


(Thanks to James Shoemaker for helping out with this on the IRC channel)

I've been using an option in Putty (under Connection -> Seconds between 
keepalives) to make an ssh connection much more robust.

I wanted to do the same thing using the linux ssh command. The syntax 
for this goes something like:

ssh -o ServerAliveInterval=15 -o ServerAliveCountMax=10 <hostname>

The application for this is I have a client that's using an ssh tunnel 
to secure another protocol, but the tunnel sometimes drops. Hopefully 
this will help.

BTW, you need a fairly recent version of SSH to make this work. When I 
tried it before, I was reading the man page on a Mandrake 10.2 server 
and trying the command on an older Mandrake 9.2 server... and it failed.

James mentioned that it was some Debian developers that pushed for the 
keepalive options, and it does work under Debian.

-dc