linux server
# vi /etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 3
# 注:
# ClientAliveInterval选项定义了每隔多少秒给SSH客户端发送一次信号;
# ClientAliveCountMax选项定义了超过多少秒后断开与ssh客户端连接
linux client
# vi /etc/ssh/ssh_config
ServerAliveInterval 60
ServerAliveCountMax 3
# 注:
# ServerAliveInterval选项定义了每隔多少秒给SSH服务端发送一次信号;
# ServerAliveCountMax选项定义了超过多少秒后断开与ssh服务端连接
Windows clients find the installation path
C:\Program Files\Git\etc\ssh\ssh_config
ConnectTimeout 600