美文网首页
Linux远程连接超时断开

Linux远程连接超时断开

作者: 李得志_春风得意马蹄疾 | 来源:发表于2019-10-28 16:55 被阅读0次

    通过客户端远程登录Linux,在一段时间没有操作后,连接将被断开,已经进入了目录和执行命令的记录将丢失。

    以下方法可以延长连接的时间。

    /etc/ssh/sshd_config中ClientAliveInterval默认被注释。将ClientAliveInterval的值设置为300秒。
    ...
    vim /etc/ssh/sshd_config
    ClientAliveInterval 300
    ...

    重载sshd服务
    systemctl reload sshd.service

    ClientAliveInterval的意义
    man sshd
    man 5 sshd_config
    ClientAliveInterval
    Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted(加密) channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol(协议) version 2 only.

    相关文章

      网友评论

          本文标题:Linux远程连接超时断开

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