On Fri, 11 Aug 2023 at 13:23, Andrei Coada <andrei.raz...@gmail.com> wrote:
> On Fri, 11 Aug 2023 at 12:57, Richard Lewis < > richard.lewis.deb...@googlemail.com> wrote: > >> On Fri, 11 Aug 2023 01:11:49 +0100 Andrei Coada <andrei.raz...@gmail.com> >> wrote: >> > Hi Team, >> > >> > This is getting pretty annoying, a 9 years old inconvenience, especially >> > now that Debian 12 does not even have a syslog service installed by >> default. >> > Fail2ban fails to start right after its installation. >> >> did you read the esrlier messages in the bug report - those messages >> say that fail2ban works provided python3-systemd is installed. there is no >> need to edit any config files. >> >> > Hi Richard, > > Thanks for your swift reply. > python3-systemd is just a wrapper that ties python to systemd's functions. > How would one expect it to magically solve this issue if no one _instructs_ > the SSHD jail to actually use the logs in the journal instead of some file > logs(which is the default setting)? > > Reproduction: > default paths_debian.conf contents > > # dpkg -l | grep python3-systemd > ii python3-systemd 235-1+b2 amd64 > Python 3 bindings for systemd > > root@blabla:/etc/fail2ban# service fail2ban start > root@blabla:/etc/fail2ban# service fail2ban status > × fail2ban.service - Fail2Ban Service > Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; > preset: enabled) > Active: failed (Result: exit-code) since Fri 2023-08-11 15:14:52 > EEST; 5s ago > Duration: 123ms > Docs: man:fail2ban(1) > Process: 91337 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, > status=255/EXCEPTION) > Main PID: 91337 (code=exited, status=255/EXCEPTION) > CPU: 120ms > Aug 11 15:14:52 seif.radiocom.ro systemd[1]: Started fail2ban.service - > Fail2Ban Service. > Aug 11 15:14:52 seif.radiocom.ro fail2ban-server[91337]: 2023-08-11 > 15:14:52,937 fail2ban [91337]: ERROR Failed during > configuration: Have not found any log file for sshd jail > Aug 11 15:14:52 seif.radiocom.ro fail2ban-server[91337]: 2023-08-11 > 15:14:52,940 fail2ban [91337]: ERROR Async configuration > of server failed > > > There are at least 2 options I can think of to overcome this issue: > 1. Add sshd_backend = systemd to paths_debian.conf > 2. Create a jail.local file with the following contents: > [sshd] > backend = systemd > enabled = true > > Then it'll work. > > In conclusion, just installing python3-systemd package _won't_ fix > anything, therefore this should still be considered a bug, as this software > does _NOT_ work out-of-the-box. > > Thanks, > Andrei > Hi again, Also, it seems to me that you've skipped some reading from the original bug report. I quote Tiziano Zito, saying: "In order to have the sshd jail to work correctly I had to: 1. install python3-systemd, which is right now only suggested by fail2ban, but given that systemd is going to be default in jessy it should probably become a Depends 2. activate the systemd backend by adding [DEFAULT] backend = systemd to the jail.d/defaults-debian.conf file" So switching to the systemd backend was there from the beginning. Thanks, Andrei