云服务器手记

修改云服务器 ssh 配置文件
(1)打开配置文件:

vim /etc/ssh/sshd_config

(2)找到下面两行:

#ClientAliveInterval 0
#ClientAliveCountMax 3

(3)去掉注释,并修改其值:

ClientAliveInterval 30
ClientAliveCountMax 86400

这两行的意思分别是:
  1、客户端每隔多少秒向服务发送一个心跳数据;
  2、客户端多少秒没有相应,服务器自动断掉连接。

(4)重启sshd服务:

service sshd restart

  

原文地址:https://www.cnblogs.com/cxscode/p/12926567.html