09 enero, 2024

Fail2ban raspberry pi service.

 sudo systemctl status fail2ban

× fail2ban.service - Fail2Ban Service

     Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)

     Active: failed (Result: exit-code) since Tue 2024-01-09 16:06:11 CST; 12min ago

   Duration: 386ms

       Docs: man:fail2ban(1)

    Process: 2013 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)

   Main PID: 2013 (code=exited, status=255/EXCEPTION)

        CPU: 345ms


Jan 09 16:06:10 NAS systemd[1]: Started fail2ban.service - Fail2Ban Service.

Jan 09 16:06:10 NAS fail2ban-server[2013]: 2024-01-09 16:06:10,993 fail2ban.configreader   [2013]: WARNING 'allowipv6' not def>

Jan 09 16:06:11 NAS fail2ban-server[2013]: 2024-01-09 16:06:11,031 fail2ban                [2013]: ERROR   Failed during confi>

Jan 09 16:06:11 NAS fail2ban-server[2013]: 2024-01-09 16:06:11,040 fail2ban                [2013]: ERROR   Async configuration>

Jan 09 16:06:11 NAS systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION

Jan 09 16:06:11 NAS systemd[1]: fail2ban.service: Failed with result 'exit-code'.


FIX:

$ sudo vi /etc/fail2ban/jail.conf

backend = auto

cambiar por

backend = systemd

listo!

fail2ban.service - Fail2Ban Service

     Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)

     Active: active (running) since Tue 2024-01-09 16:21:46 CST; 3s ago

       Docs: man:fail2ban(1)

   Main PID: 2338 (fail2ban-server)

      Tasks: 5 (limit: 1585)

        CPU: 356ms

     CGroup: /system.slice/fail2ban.service

             └─2338 /usr/bin/python3 /usr/bin/fail2ban-server -xf start