From ae154447643ed82a54446b3ff83fc52613e9c4df Mon Sep 17 00:00:00 2001 From: cnphpbb Date: Sun, 8 Nov 2026 22:29:45 +0800 Subject: [PATCH] =?UTF-8?q?build(etc):=20=E6=B7=BB=E5=8A=A0=20SSH=20?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8A=A0=E5=9B=BA=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/sshd_config.d/99-hardening.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 etc/sshd_config.d/99-hardening.conf diff --git a/etc/sshd_config.d/99-hardening.conf b/etc/sshd_config.d/99-hardening.conf new file mode 100644 index 0000000..022b80c --- /dev/null +++ b/etc/sshd_config.d/99-hardening.conf @@ -0,0 +1,18 @@ +PasswordAuthentication no +KbdInteractiveAuthentication no +PubkeyAuthentication yes +AuthenticationMethods publickey +PermitRootLogin prohibit-password +AllowUsers yong +MaxAuthTries 3 +LoginGraceTime 30 +ClientAliveInterval 300 +ClientAliveCountMax 2 +X11Forwarding no +AllowAgentForwarding no +AllowStreamLocalForwarding no +MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com +RequiredRSASize 2048 +LogLevel VERBOSE +MaxStartups 10:30:60 +RekeyLimit 1G 3600