Xshell连接Linux服务器总掉线怎么解决?,xshelllinux


Xshell连接linux服务器总掉线,解决办法如下:

1、登录服务器后

[root@test134 ~]# cd /etc/ssh/

[root@test134 ssh]# vim sshd_config

找到 ClientAliveInterval 0和ClientAliveCountMax 3并将注释符号("#")去掉,

将ClientAliveInterval对应的0改成3600,保存。

ClientAliveInterval 指定了服务器端向客户端请求消息 的时间间隔, 默认是0, 不发送.

ClientAliveInterval 3600表示每1个小时发送一次, 然后客户端响应, 这样就保持长连接了.

ClientAliveCountMax, 使用默认值3即可.ClientAliveCountMax表示服务器发出请求后客户端没有响应的次数达到一定值, 就自动断开.

2、重启ssh服务

service sshd restart

相关内容