ssh long connection Tencent cloud server centos

 When connecting Tencent cloud server via ssh, a little from time to time will not operate the connection is disconnected, to solve this problem need to make some adjustments to the configuration file. Referring to introduce the Internet, try the two programs, we tested the second option has no effect on my machine (the machine might work for other systems), the first option is feasible.
1. Edit / etc / ssh / sshd_config file
ssh long connection Tencent cloud server centos
uncomment red boxes on the two parameters of the FIG, and press on FIG adjustment parameter.

ClientAliveInterval:服务端每隔几秒向客户端发送一个心跳数据
ClientAliveCountMax:客户端多少次没有响应,服务端自动断掉连接

After the parameter adjustment, ssh disconnect and reconnect, successfully resolved the problem.

2. Edit / etc / ssh / ssh_config file
ssh long connection Tencent cloud server centos
increased two parameters on the red box in FIG end of the file.

ServerAliveInterval:每隔多少秒客户端向服务端发送一次心跳(alive 检测)
ServerAliveCountMax:服务端多少次心跳无响应之后,客户端才会认为与服务器的 SSH 连接已经断开,然后断开连接

Reproduced in: https: //blog.51cto.com/abezoo/2408670

Guess you like

Origin blog.csdn.net/weixin_33840661/article/details/92129018