You can use the following commands to inspect and trouble shoot its operation:

# fail2ban usually add new rules to your IPTables
$ sudo iptables -L
# You can check the status of specific rules using the command:
$ sudo fail2ban-client status ssh
# and of course check log to see if it is working:
$ sudo tail -f /var/log/fail2ban.log

Protecting WordPress Comments

By default fail2ban protect many services including ssh but let’s assume you want to protect WordPress from spam bots trying to post comments on your blog.

First we add a filter to catch the attempts by creating new filter file named “/etc/fail2ban/filter.d/wordpress-comment.conf”: