#vi /etc/ssh/ssh_config
ServerAliveInterval 60
ServerAliveCountMax 3
#vi /etc/ssh/sshd_config
#找到以下两行
#ClientAliveInterval 0
#ClientAliveCountMax 3
#修改为
ClientAliveInterval 60
ClientAliveCountMax 3
#然后保存,重启 sshd服务
systemctl restart sshd
#vi /etc/ssh/ssh_config
ServerAliveInterval 60
ServerAliveCountMax 3
#vi /etc/ssh/sshd_config
#找到以下两行
#ClientAliveInterval 0
#ClientAliveCountMax 3
#修改为
ClientAliveInterval 60
ClientAliveCountMax 3
#然后保存,重启 sshd服务
systemctl restart sshd