Read the fail2ban sshd jail from the journal, Debian 12+ has no auth.log and the jail failed to start

This commit is contained in:
2026-10-13 16:36:08 +00:00
parent deb3521bfa
commit 1ede3d3329
3 changed files with 16 additions and 0 deletions
+5
View File
@@ -5,3 +5,8 @@
systemd: systemd:
name: systemd-journald name: systemd-journald
state: restarted state: restarted
- name: restart_fail2ban
systemd:
name: fail2ban
state: restarted
+9
View File
@@ -0,0 +1,9 @@
# Debian 12+ ships no syslog daemon, so there is no /var/log/auth.log and the
# file-based sshd jail refuses to start; read sshd from the journal instead.
- name: Read the sshd jail from the journal
copy:
dest: /etc/fail2ban/jail.d/sshd-systemd.conf
content: |
[sshd]
backend = systemd
notify: restart_fail2ban
+2
View File
@@ -1,5 +1,7 @@
- import_tasks: ./packages.yml - import_tasks: ./packages.yml
- import_tasks: ./fail2ban.yml
- import_tasks: ./ssh.yml - import_tasks: ./ssh.yml
- import_tasks: ./packages.yml - import_tasks: ./packages.yml