SSH超时自动断开问题解决



[root@hxzlyj_web etc]# 
Last login: Sat Jan 28 08:59:18 2017 from 223.220.37.211
[root@hxzlyj_web ~]# grep "ClientAlive"  /etc/ssh/sshd_config
#ClientAliveInterval 0
#ClientAliveCountMax 3
[root@hxzlyj_web ~]# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.20170128
[root@hxzlyj_web ~]# cd /etc/ssh/
[root@hxzlyj_web ssh]# sed -i "s/#ClientAliveInterval 0/ClientAliveInterval 60/g" sshd_config
[root@hxzlyj_web ssh]# sed -i "s/#ClientAliveCountMax 3/ClientAliveCountMax 3/g" sshd_config
[root@hxzlyj_web ssh]# diff sshd_config sshd_config.20170128
127,128c127,128
< ClientAliveInterval 60
< ClientAliveCountMax 3
---
> #ClientAliveInterval 0
> #ClientAliveCountMax 3
[root@hxzlyj_web ssh]# service sshdrestart
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
[root@hxzlyj_web ssh]# service sshd restart
Redirecting to /bin/systemctl restart  sshd.service

你可能感兴趣的:(Unix_Linux,Web,Link)