notthebee / ansible-easy-vpn

An Ansible playbook that sets up a Wireguard server with ad blocking, DNS-over-HTTPS, and a WebUI with 2FA
Other
996 stars 237 forks source link

Fail2ban failed on Debian 12 - solved #283

Open j323m13 opened 3 months ago

j323m13 commented 3 months ago

On Debian 12, fail2ban needs a bit more configuration to start. Without the service will crash. If you run the following command:

systemctl status fail2ban.service

you get:

× fail2ban.service - Fail2Ban Service Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Fri 2024-03-15 18:43:15 CET; 6min ago Duration: 92ms Docs: man:fail2ban(1) Process: 3294 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION) Main PID: 3294 (code=exited, status=255/EXCEPTION) CPU: 78ms

Solution: In the file:

/etc/fail2ban/jail.local

add:

[sshd] backend=systemd enabled = true

then restart the server or fail2ban. Run the command systemctl status fail2ban.service

fail2ban.service - Fail2Ban Service Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled) Active: active (running) since Fri 2024-03-15 18:54:33 CET; 1min 29s ago Docs: man:fail2ban(1) Main PID: 530 (fail2ban-server) Tasks: 5 (limit: 2315) Memory: 52.3M CPU: 509ms CGroup: /system.slice/fail2ban.service └─530 /usr/bin/python3 /usr/bin/fail2ban-server -xf start

Problem solved.

DiMMMMM0N commented 2 months ago

I did everything according to the instructions, but the error remains. Debian 12