Keeping an SSH session to my Linode open
I use Ubuntu 9.10 vmware images locally, and Ubuntu 9.10 images on Linode.
Opening a putty ssh session to my local machine will stay alive indefinately.
However, my putty connection to my Linode will die after a certain (short) period of inactivity.
This is really annoying.
I've checked 'TCPKeepAlive yes' in sshd_config is set on my Linode and it is.
Is there a different setting thats causing this to happen?
Or is it a Linode firewall thing?
11 Replies
ClientAliveInterval 60
@mjrich:
Adding the ClientAliveInterval option to /etc/ssh/sshd_config (and restarting sshd) may help, e.g.
ClientAliveInterval 60
Hey, thanks. I'm trying that now.
ClientAliveInterval 60 is not set in my local sshd_config file, and connection to that one is working fine.
Client is Putty.
Local server is Ubuntu 9.10 (connections stay valid forever)
Linode server is Ubuntu 9.10 (drops after ~2 mins of inactivity)
Initially I tried ClientAliveInterval 60, but that still wasn't working.
So I set ClientAliveInterval 30 on the server. Very low I know. But it works.
Now it's consistently holding the connection open for ~20 mins. Havn't tried any longer.
Important point is that now I don't have to press "enter" every minute into my terminal while Im working LOL.
Thanks!
In Putty, under "Connection", "Seconds between keepalives (0 to turn off)", change that to "300" or so.
That will keep your session alive indefinitely without having to press "enter" or anything.
@BarkerJr:
I solved the problem by upgrading from my old Linksys router to a new Dlink router.
Which linksys? Some of them can be updated with new (free) firmware; I use "tomato" on my wrt54g and set the timeout to 5 days. If an ssh session is that idle then it deserves to be disconnected:-)