SSH session times out quickly
Thanks.
2 Replies
@rlfprog:
I log into my Debian linode using SSH and I've noticed that I seem to get timed out after two or three minutes of inactivity. Is this normal? If so, is there any way I can extend the timeout period?
Thanks.
It sounds most likely like a NAT timeout on your local router, or at least that's more likely than something on your Linode, since sshd won't normally time out (in fact barring network issues you should be able to be idle and then resume days or more later).
If you can't fix the router, depending on your SSH client, you should be able to configure a keep alive so that traffic is periodically generated by the client which will keep an overly aggressive router from shutting things down. On a Unix client that's the ServerAliveInterval setting (which you can put in your .ssh/config file for example). Windows clients may have similar options, for example Putty has a connection setting to keep your session active which does essentially the same thing.
If you have a problem configuring the client side, you could opt to enable ClientAliveInterval on the server (say in /etc/sshd_config) which will generate periodic packets the other way. But then since your client has to answer, it'll essentially act as periodic outbound traffic as well. Of course, in that case it'll go to all clients.
Just set the interval to something below when you're finding yourself shut down (60s for example).
– David