How to show all banned IP with fail2ban?

Please keep in mind that the fail2ban banning of IP is temporary in nature. The best way to have a look at the full list of IPs that have been blocked would be to check the log file: sudo zgrep ‘Ban’ /var/log/fail2ban.log* Edit: this answer previously searched for ‘Ban:’, but even in 2013 the source … Read more

How to Unban an IP properly with Fail2Ban

With Fail2Ban before v0.8.8: fail2ban-client get YOURJAILNAMEHERE actionunban IPADDRESSHERE With Fail2Ban v0.8.8 and later: fail2ban-client set YOURJAILNAMEHERE unbanip IPADDRESSHERE The hard part is finding the right jail: Use iptables -L -n to find the rule name… …then use fail2ban-client status | grep “Jail list” | sed -E ‘s/^[^:]+:[ \t]+//’ | sed ‘s/,//g’ to get the … Read more