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

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?

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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: