解决ssh链接服务器超时自动断开的问题

为了安全性;ssh默认的连接超时时间很短;经常就是发个呆就断开了;事实上是可以修改超时时间的。

示例环境:

    服务器:centos6.5

1:[root@iZ28qa8jt4uZ /]cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak              //养成备份配置项的好习惯

2:[root@iZ28qa8jt4uZ /]vim /etc/ssh/sshd_config                                           

    //删除110行ClientAliveInterval 0 前面的注释#号 并改为ClientAliveInterval 5

    //删除111行的lientAliveCountMax 3 前面的注释#号 并改为ClientAliveCountMax 180

    1.jpg

3:[root@iZ28qa8jt4uZ /]service sshd reload;

   [root@iZ28qa8jt4uZ /]/etc/init.d/sshd restart;

 

//重启ssh服务;

 

posted @ 2015-04-28 00:07  白俊遥  阅读(317)  评论(0编辑  收藏  举报