Unblock an IP from fail2ban

To check if an IP is banned by fail2ban, run

zgrep "Ban" /var/log/fail2ban.log* | grep IP_ADDR_HERE

To unblock an IP, you should find the jail that caused the IP to block.

In following example, IP 152.67.19.86 is blocked by sshd jail

2020-07-28 00:47:09,763 fail2ban.actions        [3494]: NOTICE  [sshd] Ban 152.67.19.86
2020-07-28 00:47:11,928 fail2ban.filter         [3494]: INFO    [sshd] Found 152.67.19.86 - 2020-07-28 00:47:11

To unban the IP, run

root@controlpanel:~# fail2ban-client set sshd unbanip 152.67.19.86
152.67.19.86
root@controlpanel:~# 

You can see all jails with command fail2ban-client status

root@controlpanel:/var/log# fail2ban-client status 
Status
|- Number of jail:	4
`- Jail list:	dovecot, postfix, pure-ftpd, sshd
root@controlpanel:/var/log#

See fail2ban

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *