vi /etc/ssh/sshd_config LoginGraceTime 0 参考man sshd_config LoginGraceTime The server disconnects after this time if the user has not successfully logged in. If the value is 0, there is no time limit. The default is 120 seconds.
设置完成后重启服务reboot,或者远程执行/etc/init.d/sshd restart即可
直接执行如下命令:
#unset TMOUT