王胜凯松源草马 發表於 2023-10-5 00:00:00

Xshell用ssh连接ubuntu掉线如何解决

<p>
        Xshell用ssh连接ubuntu掉线解决方法</p>
<p>
        <strong>1、Xshell客户端设置</strong></p>
<p align="center">
        <img style="max-width:100%!important;height:auto!important;"title="Xshell用ssh连接ubuntu掉线如何解决" alt="Xshell用ssh连接ubuntu掉线如何解决" align="" src="https://zhuji.jb51.net/uploads/img/202305/d7cf222b8ac45430ed754f5c3ba1c60c.jpg"></p>
<p>
        修改Keep Alive 时间</p>
<p>
        <strong>2、服务器端修改</strong></p>
<p>
        修改/etc/ssh/sshd_config文件,找到 ClientAliveInterval 0和ClientAliveCountMax 3并将注释符号("#")去掉,</p>
<p>
        将ClientAliveInterval对应的0改成60,</p>
<p>
        ClientAliveInterval指定了服务器端向客户端请求消息 的时间间隔, 默认是0, 不发送.</p>
<p>
        ClientAliveInterval 60表示每分钟发送一次, 然后客户端响应, 这样就保持长连接了.</p>
<p>
        ClientAliveCountMax, 使用默认值3即可.ClientAliveCountMax表示服务器发出请求后客户端没有响应的次数达到一定值, 就自动断开.</p>
<p>
        <strong>重启ssh服务</strong></p>
<p>
        tinyletero@ubuntu:~$ sudo /etc/init.d/ssh stop</p>
<p>
        tinyletero@ubuntu:~$ sudo /etc/init.d/ssh start</p>
頁: [1]
查看完整版本: Xshell用ssh连接ubuntu掉线如何解决