如下在 /etc/ssh/sshd_config 中设置,可以完全禁用 ssh 的登录超时功能:
TCPKeepAlive yes ClientAliveInterval 30 ClientAliveCountMax 99999
这里的 30 秒 × 99999 次就是保持连接 2083 天。
修改之后重启 sshd.
sshd 配置的说明:http://unixhelp.ed.ac.uk/CGI/man-cgi?sshd_config+5