Sunday, March 1, 2009

Ever alive SSH session

If you are facing Session timeout issue whenever you are leaving an open session idle for some time you can make use of TCP Keepalive option in putty.

1. Open Putty
2. Go to Connection->Seconds between keepalives(0 to turn off). Give a keepalive value here in seconds, preferably 120 or above.

Advanced
1. If you are using portaputty you can set it in config file .\putty\sessions\Default%20Settings. Set TCPKeepalives=120.
2. Right inside Linux or any other UNIX we can use /etc/ssh/ssh_config. Set the variable ServerAliveInterval 60.
3. We can use screen command also. ssh host -t screen -xRe^oo.
4. Screen can exist with Putty as well. Go to Connections -> SSH -> Remote command. Then specify screen -xRe^oo

Further Readings
HowtoGeek
Metafilter

No comments: