在~/.ssh/config中加入
Host *
# 断开时重试连接的次数
ServerAliveCountMax 10
# 每隔30秒自动发送一个空的请求以保持连接
ServerAliveInterval 30
参考
https://zhuanlan.zhihu.com/p/431249844

在~/.ssh/config中加入
Host *
# 断开时重试连接的次数
ServerAliveCountMax 10
# 每隔30秒自动发送一个空的请求以保持连接
ServerAliveInterval 30
参考
https://zhuanlan.zhihu.com/p/431249844