How to clear fail2ban out of ssh iptables

The first thing you need to do is find out the IP address of the banned user.

iptables -L

This will list the current rules that exist in iptables.

You’ll see one listed as fail2ban-ssh, likely with an ip address.

To clear it, issue the follow command.

iptables -D fail2ban-ssh -s <ip_address_to_be_set_free> -j DROP

I have used the code above with Debian wheezy successfully.

Published by J.W. Spencer

JW Spencer is the lead technical architect and developer at the Digital Dream Team. He has over 25 years of technical experience in private industry and government in support of development, management, project management, and executive technical leadership. JW has the unique ability to understand complex technical problems and synthesize viable solutions. A veteran of the USMC, JW took his undergraduate studies at Southwest Texas State University, with graduate work at Texas A&M and the University of Texas at Austin. "Always go to other people's funerals, otherwise they won't come to yours." - Yogi Berra

Leave a comment

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