美文网首页
解决linux经常掉线

解决linux经常掉线

作者: Cherry300 | 来源:发表于2019-08-08 16:10 被阅读0次

    在使用docker中出现:
    解决Xshell连接Linux服务器总掉线的问题

    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表示服务器发出请求后客户端没有响应的次数达到一定值, 就自动断开.

    1. 如果没有启动,则需要启动该服务:

    1
    systemctl start sshd.service

    1. 重启 sshd 服务:

    1
    systemctl restart sshd.service
    4.设置服务开启自启:

    1
    systemctl enable sshd.service

    相关文章

      网友评论

          本文标题:解决linux经常掉线

          本文链接:https://www.haomeiwen.com/subject/zbwxjctx.html