- quickstart
- get status
- get status by service
- get list of banned ips
- enable a service jail
- verify maxretry unit
- verify regex
- whitelist
- ban ssh through iptables
apt install fail2ban
fail2ban-client status
fail2ban-client status SERVICE
fail2ban-client get SERVICE banned
- edit the file in
jail.d
and insert some service ( list in/etc/fail2ban/jail.conf
), ie
[apache-auth]
enabled = true
fail2ban-client --str2sec 1m
gives 60 ( sec ) for the input 1m
fail2ban-regex /var/log/auth.log sshd
in the following example the ip 10.10.1.33
is whitelisted
[DEFAULT]
ignoreip = 127.0.0.1/8 ::1 10.10.1.33/32
in the file in the jail.d
folder
[sshd]
enabled = true
action = iptables[name=SSH, port=ssh, protocol=tcp]