ssh tip of the day

If you ssh to hosts beyond a firewall or from within a NATted network then you’ll have noticed that SSH sessions timeout and get disconnected. I found that setting the TMOUT variable to 0 helped when not going through a firewall, and it must have been the firewall disconnecting an idle session otherwise.
Add this line to the sshd_config of the server and restart sshd. This will send a keep alive signal to the client every 360 seconds.

ClientAliveInterval 360

man 5 sshd_config will give you more information about that. This works in OpenSSH. I’m not sure if it’ll work elsewhere.


3 Comments

Craig (1 comments.) on September 30, 2005 at 10:20 pm.

Thanks! I had to reduce the time to 60 to fix the disconnects I was seeing, but this did the trick nicely.

Reply

Matt Simmons (1 comments.) on December 11, 2008 at 7:19 pm.

This is a good tip. My users have been having this issue as well at a remote office, but in my case, it was my Juniper Netscreen causing the problems. I increased the timeout for that service and the issue went away

Reply

Leave Your Comment

Your email will not be published or shared. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Holy Shmoly! is Stephen Fry proof thanks to caching by WP Super Cache