# /etc/ssh/sshd_config ClientAliveInterval 30 ClientAliveCountMax 5
ClientAliveInterval:每x秒发送一次请求,保持连接
ClientAliveCountMax:x次请求没有响应,自动断开
重启服务:
# systemctl restart sshd
【Linux】SSH连接linux时,长时间不操作就断开的解决方案
原文:https://www.cnblogs.com/lanse1993/p/12880909.html