修改ssh超时断开时间
1. 修改 sshd_config 配置文件
vi /etc/ssh/sshd_config此为服务器上设置,推荐直接在客户端设置
ClientAliveInterval 30
ClientAliveCountMax 120- ClientAliveInterval : 每隔30s 发送心跳数据
- ClientAliveCountMax : 允许超时120次数,超过后断开链接
客户端设置
# 10次心跳无响应就自动断开
ServerAliveCountMax 10
# 每5s向服务器发送一次心跳保持连接
ServerAliveInterval 52. 重启sshd服务
systemctl restart sshd