Way to avoid ssh connection timeout & freezing of terminal tab

来源:互联网 发布:恒泰证券交易软件 编辑:程序博客网 时间:2024/05/18 08:30

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

0 0
原创粉丝点击