Increase SSH session timeout

 1,056 total views,  3 views today

If you facing SSH session disconnecting problem then please follow the below steps:

This tutorial increase your ssh session. In my case I will increase it to 1 day.

Open the sshd configuration file with any preferable Linux text editor

# vim /etc/ssh/sshd_config

Add the following lines to the end of this file

TCPKeepAlive yes
ClientAliveInterval 60
ClientAliveCountMax 1440

This means ssh will not die untill (60*1440) secconds/1 day. you can increase this value as per your requirement.

Save and close the file.

Restart the ssh service

# /etc/init.d/ssh restart
# systemctl restart ssh

Done, If you face any issue regarding this please comment.


Leave a Reply

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