This commit is contained in:
2026-03-30 16:09:38 +08:00
commit cfc02abdc5
5 changed files with 306 additions and 0 deletions

26
jail.local Normal file
View File

@@ -0,0 +1,26 @@
# Fail2ban 本地自定义配置
# 目标SSH 在 20 分钟内失败超过 3 次即封禁;封禁时间从 1 分钟开始,
# 按激进倍率增长,最多到 28 天,并混入最多 3600 秒随机时间。
[INCLUDES]
before = paths-debian.conf
[DEFAULT]
# 20 分钟内累计 4 次失败时触发封禁
findtime = 20m
maxretry = 4
# 初始封禁 1 分钟,后续按倍率递增
bantime = 1m
bantime.increment = true
bantime.rndtime = 3600
bantime.maxtime = 2419200
# 12 级递增,最终封顶到 28 天
bantime.multipliers = 1 2 4 8 16 32 64 128 256 1024 10080 40320
[sshd]
enabled = true
port = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s