设置ssh超时时间的方法。
修改自己 root 目录下的.bash_profile文件,加上
export TMOUT=1000000 (以秒为单位)
然后运行:
source .bash_profile
在/etc/ssh/sshd_config中加入:
ClientAliveInterval=60
每一分钟,sshd都和ssh client打个招呼,检测它是否存在,不存在时即断开连接。
注意:设置完成后,要退出ssh远程连接,再次登录后才可以生效。因为要再读取一次./bash_profile。
客户端工具securecrt的设置方法:会话选项 –> 终端 –> 反空闲–>选中发送协议 NO-OP(p) 每 60 秒putty的设置方法:putty -> Connection -> Seconds between keepalives ( 0 to turn off ), 默认为0, 改为300。