美文网首页
解决ssh连接经常掉线

解决ssh连接经常掉线

作者: 哆啦A梦_ca52 | 来源:发表于2020-06-08 15:06 被阅读0次

vim /etc/ssh/sshd_config
找到下面两行

ClientAliveInterval 0
ClientAliveCountMax 3
去掉注释,改成

ClientAliveInterval 30
ClientAliveCountMax 86400

这两行的意思分别是

1、客户端每隔多少秒向服务发送一个心跳数据

2、客户端多少秒没有相应,服务器自动断掉连接

重启sshd服务

service sshd restart

相关文章

网友评论

      本文标题:解决ssh连接经常掉线

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