Score:1

Fail2ban will not start

sx flag

I installed Fail2ban but i can start the service. Every time i get this Error:

systemctl status fail2ban
× fail2ban.service - Fail2Ban Service
     Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2023-05-18 12:53:07 CEST; 21s ago
       Docs: man:fail2ban(1)
    Process: 18283 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)
   Main PID: 18283 (code=exited, status=255/EXCEPTION)
        CPU: 105ms

Mai 18 12:53:07 hochzeitsbilder systemd[1]: Started Fail2Ban Service.
Mai 18 12:53:07 hochzeitsbilder fail2ban-server[18283]: 2023-05-18 12:53:07,466 fail2ban             >
Mai 18 12:53:07 hochzeitsbilder fail2ban-server[18283]: 2023-05-18 12:53:07,467 fail2ban             >
Mai 18 12:53:07 hochzeitsbilder systemd[1]: fail2ban.service: Main process exited, code=exited, statu>
Mai 18 12:53:07 hochzeitsbilder systemd[1]: fail2ban.service: Failed with result 'exit-code'.
lines 1-13/13 (END)

I tryed all things i could find but nothing works till yet.

Here is also the logfile from Fail2ban:

2023-05-18 08:47:24,422 fail2ban.server         [661]: INFO    -------------------------------------->2023-05-18 08:47:24,422 fail2ban.server         [661]: INFO    Starting Fail2ban v0.11.2
2023-05-18 08:47:24,423 fail2ban.observer       [661]: INFO    Observer start...
2023-05-18 08:47:24,445 fail2ban.database       [661]: INFO    Connected to fail2ban persistent datab>2023-05-18 08:47:24,451 fail2ban.database       [661]: WARNING New database created. Version '4'
2023-05-18 08:47:24,451 fail2ban.jail           [661]: INFO    Creating new jail 'sshd'
2023-05-18 08:47:24,510 fail2ban.jail           [661]: INFO    Jail 'sshd' uses pyinotify {}
2023-05-18 08:47:24,515 fail2ban.jail           [661]: INFO    Initiated 'pyinotify' backend
2023-05-18 08:47:24,517 fail2ban.filter         [661]: INFO      maxLines: 1
2023-05-18 08:47:24,550 fail2ban.filter         [661]: INFO      maxRetry: 5
2023-05-18 08:47:24,550 fail2ban.filter         [661]: INFO      findtime: 600
2023-05-18 08:47:24,551 fail2ban.actions        [661]: INFO      banTime: 600
2023-05-18 08:47:24,551 fail2ban.filter         [661]: INFO      encoding: UTF-8
2023-05-18 08:47:24,554 fail2ban.filter         [661]: INFO    Added logfile: '/var/log/auth.log' (po>2023-05-18 08:47:24,562 fail2ban.jail           [661]: INFO    Jail 'sshd' started
2023-05-18 09:25:53,280 fail2ban.server         [661]: INFO    Shutdown in progress...
2023-05-18 09:25:53,281 fail2ban.observer       [661]: INFO    Observer stop ... try to end queue 5 s>2023-05-18 09:25:53,301 fail2ban.observer       [661]: INFO    Observer stopped, 0 events remaining.
2023-05-18 09:25:53,341 fail2ban.server         [661]: INFO    Stopping all jails
2023-05-18 09:25:53,342 fail2ban.filter         [661]: INFO    Removed logfile: '/var/log/auth.log'
2023-05-18 09:25:53,543 fail2ban.actions        [661]: NOTICE  [sshd] Flush ticket(s) with iptables-m>2023-05-18 09:25:54,544 fail2ban.jail           [661]: INFO    Jail 'sshd' stopped
2023-05-18 09:25:54,545 fail2ban.database       [661]: INFO    Connection to database closed.
2023-05-18 09:25:54,545 fail2ban.server         [661]: INFO    Exiting Fail2ban

Can you help me?

Martin Thornton avatar
cn flag
The error message was off the screen. [Edit] into the question the output from `systemctl status fail2ban|cat` instead to force it to word-wrap. The logfile is from before you had the error.
Score:-1
ng flag

I had the same issue on Ubuntu 22.04.

First, make sure that all the jails you have enabled refer to services that actually exist. E.g., if you enabled all jails for Apache, make sure Apache is installed.

After that, restart the machine. After the restart, check the status of fail2ban with service fail2ban status. If it is not started, start it manually with service fail2ban start. Check that it is running and that all jails are loaded, via fail2ban-client status.

To make the automatic startup of fail2ban persistent after each reboot, use the systemctl enable fail2ban command, since on Ubuntu 22.04 fail2ban is disabled by default (unlike earlier versions of Ubuntu):

# systemctl enable fail2ban
Synchronizing state of fail2ban.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable fail2ban
Created symlink /etc/systemd/system/multi-user.target.wants/fail2ban.service → /lib/systemd/system/fail2ban.service.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.