ERROR Found no accessible config files for 'fail2ban' under /etc/fail2ban

So my fail2ban wasn't working and in attempts to make it work the config files got messy. Decided to start from scratch.

I ran these as sudo

apt-get remove fail2ban

apt-get purge fail2ban

rm -r /etc/fail2ban

In hopes I'd completely remove it as the first two commands kept the messy config files.

So now when I apt-get install fail2ban it downloads and installs the package, however has this when I try to run it

 * Starting authentication failure monitor fail2ban                                                                                                                                                                            ERROR  Found no accessible config files for 'fail2ban' under /etc/fail2ban
ERROR  No section: 'Definition'
ERROR  No section: 'Definition'
ERROR  Found no accessible config files for 'fail2ban' under /etc/fail2ban
ERROR  Found no accessible config files for 'jail' under /etc/fail2ban
ERROR  No section: 'Definition'
ERROR  No section: 'Definition'

These config files are indeed missing. Why aren't they recreated when I reinstalled F2B? How can I start from scratch and reinstall it as default?

I'm using Ubuntu 14.04.2 LTS


Solution 1:

I fix the issue with :

service fail2ban stop
rm -r /etc/fail2ban/
apt-get purge fail2ban

apt-get install fail2ban

Solution 2:

I have a similar problem with some configs and I just solved it. Try to get them from:

/usr/share/doc/fail2ban/dist-config

You can copy jail.conf and fail2ban.conf to /etc/fail2ban

There are other many other sources in folders action.d/ and filter.d/ and you can copy then into /etc/fail2ban/ corresponding folder (as you said).

Solution 3:

Download the files you need directly from GitHub.

cd /etc/fail2ban/
wget https://raw.githubusercontent.com/fail2ban/fail2ban/0.11/config/fail2ban.conf
wget https://raw.githubusercontent.com/fail2ban/fail2ban/0.11/config/jail.conf