您的位置:首页 > 其它

SSH超时自动断开问题解决

2017-01-28 09:15 375 查看
[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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: