Skip to content

fail2ban

Install:

apt install fail2ban

Configure

  • Don't modify main /etc/fail2ban/jail.conf, use a file like /etc/fail2ban/jail.d/custom.local
  • Add trusted, static IPs with the ignoreip directive
ignoreip = 127.0.0.1/8 ::1 1.2.3.4/32

Validate and show merged config:

fail2ban-client -d

Show status

systemctl status fail2ban.service
fail2ban-client status
fail2ban-client status sshd

Unban IP:

fail2ban-client set sshd unbanip 84.158.175.229