http://www.shocr.com/ssh-timeout/
Vim/etc/ssh/sshd_config
[Root@blinux ~]# defines how long a request for a client has not been received as a timeout, in seconds
Clientaliveinterval 600
[Root@blinux ~]# allows the timeout mentioned above, the default is 3
Clientalivecountmax 6
The product of the above two definitions is the time of timeout
Note that after you change the configuration, remember to reboot SSH
[Root@blinux ~]# Service sshd restart
Some people have doubts, directly increase the value of clientaliveinterval can not, why to modify the Clientalivecountmax?
In fact, you can do this. Think of the two ways the effect of the definition is different.
Take Clientaliveinterval * Clientalivecountmax 6 and Clientaliveinterval 1200 (note that the Clientalivecountmax default is 3)
The previous meaning is to allow 6 times 10 minutes without corresponding action, the meaning of the following is to allow 3 times 20 minutes without corresponding action.
Whether the difference is obvious, here they are willing to choose which to look at personal situation.