Guides · Linux servers · 3 min read
fail2ban will not start on Debian 12
Debian 12 and later log SSH logins to the systemd journal only, so the default sshd jail has no file to read and fail2ban exits. Tell it to read the journal.
What you see
You installed fail2ban and enabled the sshd jail. systemctl status fail2ban shows it failed, and the journal says the log file it needs is missing:
Why it happens
fail2ban's sshd jail reads /var/log/auth.log by default. Debian 12 no longer installs rsyslog, so nothing writes that file: SSH logins go to the systemd journal only. Ubuntu still writes /var/log/auth.log, which is why the same setup works there.
The fix: read the journal
- Install the Python bindings fail2ban uses to read the journal: python3-systemd.
- Put your jail settings in a file of their own under /etc/fail2ban/jail.d/ (never edit jail.conf: updates replace it) with backend = systemd.
- Restart fail2ban and check that the jail is running.
Check it works
fail2ban-client status sshd lists the jail with its counters. Failed logins from the internet arrive within minutes on any public server, so Currently failed should start counting soon. Before you test a ban from your own address, make sure you can still reach the server another way (your provider's console), or add your address to ignoreip in the same file.
With AskYourStack connected, Claude, ChatGPT or Cursor can do this on your server, following our tested playbook, and nothing changes until you open changes on that server. Paste this:
More: Server hardening with your AI, VPS setup.
More guides
WordPress 7.1 fails its checksum check after wp core download
A fresh install made with wp-cli reports files that do not exist under wp-includes/php-ai-client. The archive was unpacked with file names cut short. Install core from the official zip instead.
Is that really Googlebot? Check by reverse DNS
Anyone can send a Googlebot user agent. Before you block, rate-limit or trust a crawler in your logs, check its address: a real one resolves to Google's or Microsoft's names and back.