Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Fail2Ban on Bookworm Active: failed (Result: exit-code)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
GabrieleMax
Posts: 126
Joined: 2016-09-07 20:24
Location: Senigallia (AN) - Italy
Has thanked: 4 times
Been thanked: 1 time
Contact:

[Solved] Fail2Ban on Bookworm Active: failed (Result: exit-code)

#1 Post by GabrieleMax »

Hi guys,

I installed Fail2Ban on my Debian Bookworm from repository by aptitude install fail2ban, it's my first experience and maybe I should do something to configure it like what I do for Samba and other services; here below you can find the result of systemctl status fail2ban.service

Code: Select all

× fail2ban.service - Fail2Ban Service
     Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Thu 2023-11-09 12:55:03 CET; 2min 10s ago
   Duration: 49ms
       Docs: man:fail2ban(1)
    Process: 1682 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)
   Main PID: 1682 (code=exited, status=255/EXCEPTION)
        CPU: 47ms

nov 09 12:55:03 SRV01 systemd[1]: Started fail2ban.service - Fail2Ban Service.
nov 09 12:55:03 SRV01 fail2ban-server[1682]: 2023-11-09 12:55:03,709 fail2ban                [1682]: ERROR   Failed during configuration: File contains no section headers.
nov 09 12:55:03 SRV01 fail2ban-server[1682]: file: '/etc/fail2ban/jail.local', line: 21
nov 09 12:55:03 SRV01 fail2ban-server[1682]: ' bantime = 1h\n'
nov 09 12:55:03 SRV01 fail2ban-server[1682]: 2023-11-09 12:55:03,711 fail2ban                [1682]: ERROR   Async configuration of server failed
nov 09 12:55:03 SRV01 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
nov 09 12:55:03 SRV01 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
I opened /etc/fail2ban/jail.local and at line 21 there's bantime = 1h and also if I enable\disable it I have the same error.

If i do fail2ban-client start I have:

Code: Select all

2023-11-09 13:16:34,198 fail2ban.configreader   [2104]: WARNING 'allowipv6' not defined in 'Definition'. Using default one: 'auto'
2023-11-09 13:16:34,203 fail2ban                [2104]: ERROR   Failed during configuration: Have not found any log file for sshd jail
Regards.
GabrieleMax
Last edited by GabrieleMax on 2023-12-12 11:33, edited 1 time in total.

Aki
Global Moderator
Global Moderator
Posts: 3082
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 76 times
Been thanked: 417 times

Re: Fail2Ban on Bookworm Active: failed (Result: exit-code)

#2 Post by Aki »

Hello,

fail2ban usually works "out the box" after installation in Debian Bookworm. After that, it can be customized, of course.

Therefore, I suspect you messed up something in the program's configuration files (as error messages report) after installing it.

Please check the configuration files of the program.

Let me know.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Aki
Global Moderator
Global Moderator
Posts: 3082
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 76 times
Been thanked: 417 times

Re: Fail2Ban on Bookworm Active: failed (Result: exit-code)

#3 Post by Aki »

@GabrieleMax: have you fixed Fail2Ban configuration ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

GabrieleMax
Posts: 126
Joined: 2016-09-07 20:24
Location: Senigallia (AN) - Italy
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Fail2Ban on Bookworm Active: failed (Result: exit-code)

#4 Post by GabrieleMax »

Aki wrote: 2023-11-18 18:32 @GabrieleMax: have you fixed Fail2Ban configuration ?
I installed a new VM and now everything is ok, maybe I did something wrong, I am in testing environment this is the reason why I did it! :)

GabrieleMax

Aki
Global Moderator
Global Moderator
Posts: 3082
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 76 times
Been thanked: 417 times

Re: Fail2Ban on Bookworm Active: failed (Result: exit-code)

#5 Post by Aki »

GabrieleMax wrote: 2023-12-10 17:01
Aki wrote: 2023-11-18 18:32 @GabrieleMax: have you fixed Fail2Ban configuration ?
I installed a new VM and now everything is ok, maybe I did something wrong, I am in testing environment this is the reason why I did it! :)

GabrieleMax
I'm glad you sorted it out. :)

Please, mark the discussion as "solved" manually adding the text tag "[Solved]" at the beginning of the subject of the first message.

Happy Debian ! .)
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply