One - One Code All

Blog Content

阿里云服务器SSH经常过一会就断开连接解决办法

Linux-Mac   2018-03-03 07:33:11

vim /etc/ssh/sshd_config


找到下面两行:


#ClientAliveInterval 0

#ClientAliveCountMax 3

去掉注释,改为:


ClientAliveInterval 30

ClientAliveCountMax 1800

这两行的意思分别为:


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

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


重启SSHD服务


service sshd restart



上一篇:macos安装xcode command line tool的两种方法
下一篇:Mac命令行查看系统信息

The minute you think of giving up, think of the reason why you held on so long.