Reprint: http://www.cnblogs.com/jifeng/archive/2011/06/25/2090118.html
Modify the/etc/ssh/sshd_config file to find Clientaliveinterval 0 and Clientalivecountmax 3 and remove the annotation symbol ("#")
Change the corresponding 0 of the clientaliveinterval to 60,
CLIENTALIVEINTERVAL Specifies the time interval for server-side request messages to clients, which is 0 by default and not sent.
Clientaliveinterval 60 indicates that it is sent once per minute, and then the client responds so that it remains long connected.
Clientalivecountmax, use the default value of 3. Clientalivecountmax indicates that the client does not respond to a certain number of times after the server makes a request and disconnects automatically.
Normally, the client does not respond.
To re-start the sshd service:
Service sshd Restart
Workaround: Workaround for Linux ssh Secure Shell (SSH) timeout break