阿里云服务器ssh连接每隔一段时间自动断开

修改云服务器 ssh 配置文件

# 打开文件
vim /etc/ssh/sshd_config

# 找到这两行
#ClientAliveInterval 0
#ClientAliveCountMax 3

# 修改这两行
ClientAliveInterval 30      # 客户端每隔多少秒向服务发送一个心跳数据
ClientAliveCountMax 86400   # 客户端多少秒没有相应,服务器自动断掉连接

# 重启sshd服务
service sshd restart

Guess you like

Origin blog.csdn.net/qq_39529562/article/details/108479415