Fail2ban not using my conf and also not using my rules?

Posted February 14, 2015 1.9k views

I followed the fail2ban Ubuntu 14 tutorial that started out having me cp jail.conf jail.local but clearly fail2ban is still using jail.conf based on some simple tests. So I have questions:

  1. Why would I use jail.local instead of jail.conf?
  2. If I should use the .local then how do I get fail2ban to use it?
  3. Even when I modify the jail.conf that it is using it still doesn’t ban me after invalid SSH logins. I am using a custom SSH port, so do I need to do something special to tell fail2ban what my SSH port is when not using the default port?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

The main reason why you might use a local configuration file is that /etc/fail2ban/jail.conf is installed and managed by the packaging system. You are free to edit it, but you may be prompted to merge your changes manually when upgrading the package if there are changes to that file. For a bit of a deeper dive into fail2ban works, check out this article:

by Justin Ellingwood
Fail2ban is a daemon that can be used to monitor the logs of services and ban clients that repeatedly fail authentication checks. It is a great tool to help protect against brute force attacks and malicious users. In this guide, we'll discuss how fail2ban works and how you can leverage its configuration structure to modify or extend its functionality.