General modifications two places can solve this annoying problem
1. Echo $TMOUT
If blank is displayed, it means that there is no setting, equal to using the default value of 0, and should normally not time out. If it is greater than 0, you can set it to 0 in a file such as/etc/profile.
2, modify the/etc/ssh/sshd_config file , the Clientaliveinterval 0 and Clientalivecountmax 3 of the annotation symbols removed, Change the clientaliveinterval corresponding 0 to 60,clientaliveinterval specifies the time interval of the server-to-client request message, which is 0 by default and not sent. and clientaliveinterval 60 means send every minute, The client then responds so that it remains long connected. Clientalivecountmax, use the default value of 3.
Finally remember to execute/etc/init.d/sshd restart Oh, otherwise the amendment will not be effective.
How to avoid SSH Secure Shell Client connection Linux timeout, auto disconnect?