Fail2ban failed

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.2.10
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain:
I’m trying to set long ban time and add a /etc/fail2ban/jail.d/default.local file with content of;
[DEFAULT]
bantime = 864000
findtime = 86400
maxretry = 4

Description of my issue

After making mentioned change fail2ban failed and throws following warning.

yunohost service status fail2ban
configuration: broken
configuration-details: 
  - 2024-02-12 11:13:40,406 fail2ban.configreader   [25586]: ERROR   Found no accessible config files for 'filter.d/sshd-ddos' under /etc/fail2ban
  - 2024-02-12 11:13:40,406 fail2ban.jailreader     [25586]: ERROR   Unable to read the filter 'sshd-ddos'
  - 2024-02-12 11:13:40,406 fail2ban.jailsreader    [25586]: ERROR   Errors in jail 'sshd-ddos'.
  - 2024-02-12 11:13:40,472 fail2ban.configreader   [25586]: ERROR   Found no accessible config files for 'filter.d/postfix-rbl' under /etc/fail2ban
  - 2024-02-12 11:13:40,473 fail2ban.jailreader     [25586]: ERROR   Unable to read the filter 'postfix-rbl'
  - 2024-02-12 11:13:40,473 fail2ban.jailsreader    [25586]: ERROR   Errors in jail 'postfix-rbl'.
  - 2024-02-12 11:13:40,541 fail2ban                [25586]: ERROR   Failed during configuration: Have not found any log file for selinux-ssh jail
  - 2024-02-12 11:13:40,541 fail2ban                [25586]: ERROR   ERROR: test configuration failed
description: Protects against brute-force and other kinds of attacks from the Internet
last_state_change: 2024-02-12 11:13:31
start_on_boot: enabled
status: failed

Reinstalling fail2ban doesn’t work. Purging is not an option.
How can correct fail2ban service?
Thanks in advance.

sudo dpkg -r --force-depends fail2ban
sudo rm -rf /var/lib/fail2ban /etc/fail2ban/jail.d /etc/fail2ban/filter.d
sudo apt install fail2ban
sudo yunohost tools regen-conf fail2ban --force

After applying these, the system returned to nearly normal.

1 Like