Linux VPS延长SSH连接时间设置

连接SSH服务器刚刚离开一会就断开,不得不需要反复连接服务器,为了使SSH服务器可以保持足够的连接时间,大家可以按以下方法设置:
基于安全的理由,如果用户连线到 SSH Server 后闲置,SSH Server 会在超过特定时间后自动终止 SSH 连线。以下是设定终止连线时间的方法:

1、打开 /etc/ssh/sshd_config 文件,找到一个参数为 ClientAliveCountMax,它是设定用户端的 SSH 连线闲置多长时间后自动终止连线的数值,单位为分钟。

2、如果这一行最前面有#号,将那个#号删除,并修改想要的时间。

3、修改后保存并关闭文件,重新启动 sshd:

/etc/rc.d/init.d/sshd restart

标签


Warning: error_log(/www/wwwroot/www.ctrol.cn/wp-content/plugins/spider-analyser/#log/log-0212.txt): failed to open stream: No such file or directory in /www/wwwroot/www.ctrol.cn/wp-content/plugins/spider-analyser/spider.class.php on line 2900