Question

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

  • Posted February 14, 2015

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?
Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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: