From 9f8d4d90de10f1ef392bc20521ed9ceab559fac4 Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 10 Oct 2019 12:06:14 +0800 Subject: [PATCH] =?UTF-8?q?:pencil2:=20=E6=B7=BB=E5=8A=A0=20ssh=20?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- used-settings.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/used-settings.md b/used-settings.md index c5e9211..6a32d30 100644 --- a/used-settings.md +++ b/used-settings.md @@ -49,6 +49,25 @@ service sshd restart #重启 sshd 服务 --- +#### ssh 连接超时配置 + +把 `/etc/ssh/sshd_config` 文件中 `ClientAliveInterval` 、`ClientAliveCountMax` 两个配置修改为 + +``` +ClientAliveInterval 60 #服务端向客户端发送信息的间隔时间,单位为秒 +ClientAliveCountMax 3 #服务端发送信息的总次数 +``` + +`CentOs` 直接修改即可,`Ubuntu` 默认没有需要新增。 + +重启服务 + +``` +systemctl restart sshd +``` + +--- + #### 禁止 ping 服务器配置 第一种方法:临时生效配置