新建或编辑 /etc/ssh/ssh_config 文件,添加或修改以下参数 # 保持连接 TCPKeepAlive yes # 每5分钟向服务端发送一个数据包 ServerAliveInterval 300