Way to avoid ssh connection timeout & freezing of terminal tab

Hit a problem on CentOS7.0 that ssh connection timeout & freezing of terminal tab after several seconds, following is the solution.


1) It's most likely the shell which is timing out. Disable the timeout by unsetting TMOUT in your profile. TMOUT is the number of seconds that bash waits for input before terminating. Echo $TMOUT to see if it is set. Add the following to your profile:



unset TMOUT
2) Configure PuTTY to send keepalive packets by going into:


Settings > Connection > Seconds between keepalives = 60
3) Tweak your sshd_config (normally found in /etc/ssh) and add:


TCPKeepAlive yes
ClientAliveInterval 60

Save the file and restart sshd.


Refer: http://unix.stackexchange.com/questions/6105/what-causes-a-ssh-interruption

你可能感兴趣的:(服务器配置)