It seems after about 5 minutes an inactive ssh session is terminated. The server is Ubuntu. How can I change this?

link|improve this question

80% accept rate
feedback

migrated from stackoverflow.com Oct 17 '11 at 19:22

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 2 down vote accepted

On the server, login as root and edit /etc/ssh/sshd_config and add the line:

ClientAliveInterval 60

man sshd_config:

Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only.

You'll need to restart the sshd for it to come into effect.

Alternatively on the client edit /etc/ssh/ssh_config (if you have root and want it for all users) or ~/.ssh/config and add the line:

ServerAliveInterval 60
link|improve this answer
feedback

This question was asked and answered less than an hour ago.

Disable SSH Timeouts

link|improve this answer
feedback

Edit your ssh_config file.

Include there 'ConnectTimeout 0' to deactivate timeout.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.