【Linux】设置ssh远程连接超时时间


vim /etc/ssh/sshd_config
找到以下两项配置

#ClientAliveInterval 0
#ClientAliveCountMax 3
修改为

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

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

重启sshd服务(centos7+)

原文地址:https://www.cnblogs.com/kingdelee/p/11336670.html