有时连接一些vps,ssh会自动断开。修改下sshd-config就可以,这里做个备忘。
找到这两行:vi /etc/ssh/sshd_config
#ClientAliveInterval 0 #ClientAliveCountMax 3
修改下面两行:
ClientAliveInterval 60 ClientAliveCountMax 3
重启sshd:
然后断开现在的ssh,重新连接就可以了。service sshd restart
有时连接一些vps,ssh会自动断开。修改下sshd-config就可以,这里做个备忘。
找到这两行:vi /etc/ssh/sshd_config
#ClientAliveInterval 0 #ClientAliveCountMax 3
修改下面两行:
ClientAliveInterval 60 ClientAliveCountMax 3
重启sshd:
然后断开现在的ssh,重新连接就可以了。service sshd restart