Skip to Content

extend ssh session timeout

Categories:

Can I disable or extend the session timeout that happens after just a few minutes of inactivity when logged in via ssh?

It's pretty frustrating when administering, to be constantly booted and have to re-connect.

It's not a clean exit -- no notification, no logout... just nothing. And /proc/sys/net/ipv4/tcp_keepalive_time is set to 7200; plenty. Does that suggest it's on the firewall end?

Any help appreciated!

Comments

semi-remedied

jeffschuler's picture

It appears you might've addressed this...?

Now I get a "Connection to [hostname] closed." message.

I'd still prefer being able to configure timeout duration, but I appreciate that there's at least a cleaner exit now -- thanks!

Update: or maybe the notification is only apparent with certain ssh clients...

SSH keepalive

Take a look at the keepalive settings for your SSH client. You should be able to adjust this so that your connection doesn't time out.

keepalive, client side

jeffschuler's picture

Ben, you're a legend!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.