fail2ban installation not running

Thechaser

New Member
Mar 28, 2024
14
6
3
Hello all;

I followed this procedure:
https://pve.proxmox.com/wiki/Fail2ban

But somehow I get the following error when I request the status of the service:

Code:
root@lenovozfs:~# /etc/init.d/fail2ban status
× fail2ban.service - Fail2Ban Service
     Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2024-04-19 16:55:53 CEST; 10min ago
   Duration: 76ms
       Docs: man:fail2ban(1)
    Process: 627428 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)
   Main PID: 627428 (code=exited, status=255/EXCEPTION)
        CPU: 73ms

Apr 19 16:55:53 lenovozfs systemd[1]: Started fail2ban.service - Fail2Ban Service.
Apr 19 16:55:53 lenovozfs fail2ban-server[627428]: 2024-04-19 16:55:53,247 fail2ban.configreader   [627428]: WARNING 'allowipv6' not defined in 'Definition'. Using default one: 'auto'
Apr 19 16:55:53 lenovozfs fail2ban-server[627428]: 2024-04-19 16:55:53,254 fail2ban                [627428]: ERROR   Failed during configuration: Have not found any log file for sshd jail
Apr 19 16:55:53 lenovozfs fail2ban-server[627428]: 2024-04-19 16:55:53,258 fail2ban                [627428]: ERROR   Async configuration of server failed
Apr 19 16:55:53 lenovozfs systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Apr 19 16:55:53 lenovozfs systemd[1]: fail2ban.service: Failed with result 'exit-code'.

this is the information of my files:

/etc/fail2ban/filter.d/proxmox.conf
Code:
  GNU nano 7.2                                                                                                                                      /etc/fail2ban/filter.d/proxmox.conf                                                                                                                                              
[Definition]
failregex = pvedaemon\[.*authentication failure; rhost=<HOST> user=.* msg=.*
ignoreregex =

/etc/fail2ban/jail.local

(end of file)

Code:
[proxmox]
enabled = true
port = https,http,8006
filter = proxmox
backend = systemd
maxretry = 10
findtime = 2d
bantime = 1h


Thank you in advance, if you need more information please let me know
 
Last edited:
Update:

In this file I made an extra update after some googling
/etc/fail2ban/jail.local

Code:
[sshd]

# To use more aggressive sshd modes set filter parameter "mode" in jail.local:
# normal (default), ddos, extra or aggressive (combines all).
# See "tests/files/logs/sshd" or "filter.d/sshd.conf" for usage example and details.
#mode   = normal
port    = ssh
logpath = %(sshd_log)s
backend = systemd
#backend = %(sshd_backend)s

Now the service seems active.

Strange that this is not metioned in the wiki, on all three promox I had the same error and needed the fix.