解决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

    解决ssh链接服务器超时自动断开的问题_第1张图片

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

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


//重启ssh服务;

你可能感兴趣的:(Linux)