10/28/2014

How to keep ssh alive on centos

By default, the SSH servers are set to disconnect clients who has been inactive or idle after a certain period of time. In order to keep the ssh session alive, you may configure the ssh server.

You may change the ClientAliveInterval, TCPKeepAlive and ClientAliveCountMax options in the sshd configuration file. After you config your ssh, please do not forget to restart your ssh server.

#sudo vi /etc/ssh/sshd_config

ClientAliveInterval 100
TCPKeepAlive  yes
ClientAliveCountMax  99999

#sudo  /etc/init.d/sshd restart


No comments:

Post a Comment