1、修改sshd_config文件
vi /etc/ssh/sshd_config
找到 TCPKeepAlive yes启用
找到ClientAliveInterval 60 把后面的0改成60
2、重启sshd服务
service sshd restart
3、修改profile文件
vi /etc/profile
修改TMOUT为0
4、重启配置文件
source /etc/profile
5、将uid>=1000注释掉
vim /etc/pam.d/longin
vim /etc/pam.d/sshd
vim /etc/pam.d/system-auth
#auth requisite pam_succeed_if.so uid <= 1000 quiet_success
#account sufficient pam_succeed_if.so uid < 1000 quiet