linux服务端
# vi /etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 3
# 注:
# ClientAliveInterval选项定义了每隔多少秒给SSH客户端发送一次信号;
# ClientAliveCountMax选项定义了超过多少秒后断开与ssh客户端连接
linux客户端
# vi /etc/ssh/ssh_config
ServerAliveInterval 60
ServerAliveCountMax 3
# 注:
# ServerAliveInterval选项定义了每隔多少秒给SSH服务端发送一次信号;
# ServerAliveCountMax选项定义了超过多少秒后断开与ssh服务端连接
Windows 客户端 找到安装路径下
C:Program FilesGitetcsshssh_config
ConnectTimeout 600