编辑 /etc/ssh/ssh_config 添加如下设置可解决这个问题:ssh
# 断开时重试链接的次数 ServerAliveCountMax 5 # 每隔5秒自动发送一个空的请求以保持链接 ServerAliveInterval 5