Fail2Ban – Unban all the IPs you’ve just added to your ignore list

for IP in $(grep ^ignore /etc/fail2ban/jail.local | awk '{for(i=4;i<=NF;++i)print $i}'); do sudo fail2ban-client set ssh unbanip ${IP}; done

or

# Ignoreip = 127.0.0.1 <<-- Start at the 4th field and remove

for IP in $(grep ^ignore /etc/fail2ban/jail.local |  awk '{for(i=4;i<=NF;++i)print $i}');
do 
  sudo fail2ban-client set ssh unbanip ${IP};
done

Author: Andrew

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.