Read more

How to unban host with Fail2ban

Claus-Theodor Riegg
April 07, 2016Software engineer at makandra GmbH

To see all jails:

fail2ban status
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Our $JAIL is usually ssh.

To see which IPs are banned currently:

fail2ban-client status ssh

If you want to unban a host banned by fail2ban on Ubuntu 14.04 or later use this method:

fail2ban-client set $JAIL unbanip $IP
#example with a jail named ssh
fail2ban-client set ssh unbanip 10.0.0.20

Please don't try to undo the ban by deleting the iptables rule. Fail2ban will recreate the rule if it is missing but fail2ban has still stored the ban.

On 12.04 hosts fail2ban is too old and doesn't know the unbanip action.

sudo iptables -F

is the only way here since sudo service fail2ban restart just re-bans the IP again after starting.

Posted by Claus-Theodor Riegg to makandra Operations (2016-04-07 11:24)