- 修改/etc/ssh/sshd_config
vim /etc/ssh/sshd_config
PermitRootLogin yes #
TCPKeepAlive 300
ClientAliveInterval 120 #每隔300秒发送一个空包,保持连接
ClientAliveCountMax 720 发送10000次空包后断开连接
- 修改/etc/profile
export TMOUT = 10000
- 重启ssh
service sshd restart
vim /etc/ssh/sshd_config
PermitRootLogin yes #
TCPKeepAlive 300
ClientAliveInterval 120 #每隔300秒发送一个空包,保持连接
ClientAliveCountMax 720 发送10000次空包后断开连接
export TMOUT = 10000
service sshd restart