From db3749375c580fac991f35a612356f37a50e26bb Mon Sep 17 00:00:00 2001 From: cnphpbb Date: Sun, 8 Nov 2026 22:36:02 +0800 Subject: [PATCH] =?UTF-8?q?build(etc):=20=E6=B7=BB=E5=8A=A0=20Fail2ban=20S?= =?UTF-8?q?SH=20=E9=98=B2=E7=88=86=E7=A0=B4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/fail2ban/jail.d/sshd-hardening.local | 8 ++++++++ etc/fail2ban/jail.d/sshd.local | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 etc/fail2ban/jail.d/sshd-hardening.local create mode 100644 etc/fail2ban/jail.d/sshd.local diff --git a/etc/fail2ban/jail.d/sshd-hardening.local b/etc/fail2ban/jail.d/sshd-hardening.local new file mode 100644 index 0000000..aa3d49e --- /dev/null +++ b/etc/fail2ban/jail.d/sshd-hardening.local @@ -0,0 +1,8 @@ +[sshd] +enabled = true +maxretry = 3 +findtime = 10m +bantime = 1h +bantime.increment = true +bantime.factor = 2 +bantime.maxtime = 1w diff --git a/etc/fail2ban/jail.d/sshd.local b/etc/fail2ban/jail.d/sshd.local new file mode 100644 index 0000000..efe4a16 --- /dev/null +++ b/etc/fail2ban/jail.d/sshd.local @@ -0,0 +1,10 @@ +[sshd] +enabled = true +backend = systemd +journalmatch = _SYSTEMD_UNIT=ssh.service + _COMM=sshd + _COMM=sshd-session +maxretry = 3 +findtime = 10m +bantime = 24h +bantime.increment = true +bantime.factor = 2 +bantime.maxtime = 7d