Fail2ban指南

Admin留言 | 贡献2022年9月14日 (三) 02:35的版本 (导入1个版本)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

编写文件 /etc/fail2ban/filter.d/frps.conf

[Definition]
failregex = ^.*get a user connection \[<HOST>:[0-9]*\]
            ^.*get a new work connection: \[<HOST>:[0-9]*\]
ignoreregex =

编写文件 /etc/fail2ban/jail.local 添加(以frp为例)

[frp]
enabled = true
findtime = 300
maxretry = 3
bantime = -10d
filter = frps
logpath = /home/log/frps.log
protocol = all
chain = all
port = all
action = iptables-allports[name=frp,protocol=tcp]
         mail[name=frp, dest=w1073@qq.com]
fail2ban-client reload 重载服务和 fail2ban-client status frp 确认服务状态