Having issues with your DietPi installation or found a bug? Post it here.
mafioso12dk
Posts: 8 Joined: Wed Oct 07, 2020 9:56 am
Post
by mafioso12dk » Wed Oct 07, 2020 10:11 am
I made a new installation with RealVCN, fail2ban, samba, nextcloud, rpi-monitor and chromium. I checked today if fail2ban is even working and that's what I've got:
Code: Select all
dietpi@DietPi:~$ fail2ban-client status dropbear
Failed to access socket path: /var/run/fail2ban/fail2ban.sock. Is fail2ban running?
I checked the path
/var/run/fail2ban and there is no file/folder fail2ban.sock
Anyone knows where is the problem?
Thank you in advance
Joulinar
Posts: 3742 Joined: Sat Nov 16, 2019 12:49 am
Post
by Joulinar » Wed Oct 07, 2020 1:00 pm
Hi,
many thanks for your message. I guess your service is not running. Pls can you check
If you see something like the following, a value within config file is missing
Code: Select all
Oct 07 12:52:31 DietPi3 fail2ban-server[683]: Failed during configuration: Bad value substitution: option 'filter' in section 'dropbear' contains an interpolation key 'mode' which is not a valid option name. Raw value: '%(__name__)s[mode=%(mode)s]'
A quick fix would be following
And add
mode = normal before
filter . Should looks like this
Code: Select all
[DEFAULT]
enabled = true
ignoreip = 127.0.0.1/8
ignorecommand =
backend = systemd
mode = normal
filter = %(__name__)s[mode=%(mode)s]
findtime = 600
Once done save the file and restart the service
Code: Select all
systemctl restart fail2ban.service
systemctl status fail2ban.service
Status should be
active (running) now
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
mafioso12dk
Posts: 8 Joined: Wed Oct 07, 2020 9:56 am
Post
by mafioso12dk » Wed Oct 07, 2020 5:30 pm
After status check I got this message:
Code: Select all
dietpi@DietPi:~$ systemctl status fail2ban.service
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset:
enabled)
Active: failed (Result: exit-code) since Wed 2020-10-07 10:49:56 B
ST; 5h 34min ago
Docs: man:fail2ban(1)
Process: 487 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, status
=0/SUCCESS)
Process: 491 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited
, status=255/EXCEPTION)
Main PID: 491 (code=exited, status=255/EXCEPTION)
But your method helped. Now it works. Thanks for help
Joulinar
Posts: 3742 Joined: Sat Nov 16, 2019 12:49 am
Post
by Joulinar » Wed Oct 07, 2020 5:40 pm
ok good that it is working now.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
MichaIng
Site Admin
Posts: 2613 Joined: Sat Nov 18, 2017 6:21 pm
Post
by MichaIng » Wed Oct 07, 2020 6:18 pm
Many thanks for reporting. But @mafioso12dk does your service status still shows a failing state, or was this before the fix? In case check again, or the logs only:
journalctl -u fail2ban
Joulinar
Posts: 3742 Joined: Sat Nov 16, 2019 12:49 am
Post
by Joulinar » Wed Oct 07, 2020 7:45 pm
@MichaIng
It's working now, if I understood correctly
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team