This guide shows how to install Fail2Ban on Debian Linux and configure it to protect your server from brute-force attacks and automated intrusion attempts. Fail2Ban monitors log files for repeated failed login attempts or other suspicious behavior and automatically bans offending IP addresses by updating firewall rules. Installing Fail2Ban on Debian provides immediate protection for SSH, web servers, mail services, and other network-facing applications through pre-configured jails that adapt to your server environment.
On Debian, Fail2Ban installs quickly from the default repositories and hardens your system’s defenses with minimal effort. Once installed, you can tailor jails, ban times, and notification settings to match your environment. You will learn how to install Fail2Ban from Debian repositories, configure firewall backends for iptables or nftables, enable SSH protection immediately after installation, customize jail settings for Apache and other services, manage IP bans manually, monitor security logs in real time, troubleshoot common configuration issues, and remove Fail2Ban if you no longer need it.
Debian 13 (Trixie) is the current stable release, and Debian 12 (Bookworm) remains supported as oldstable. Both versions ship Fail2Ban in their default repositories with iptables-multiport as the default firewall backend. Debian 11 (Bullseye) remains in LTS support until August 2026 and ships an older Fail2Ban version (0.11.2) that also works with this guide.
What Is Fail2Ban?
Fail2Ban is an intrusion prevention framework that protects Linux servers from automated attacks. Think of it as a security guard that watches your server’s log files around the clock, looking for signs of malicious activity like repeated failed login attempts, password guessing, or exploit scanning. When Fail2Ban detects suspicious patterns, it automatically blocks the attacker’s IP address by adding firewall rules, preventing further access for a configurable period.
The tool works with jails, which are monitoring rules for specific services. Each jail watches a particular log file (such as /var/log/auth.log for SSH) and applies filters to detect attack patterns. When an IP address triggers too many failures within a defined time window, Fail2Ban executes a ban action that blocks the offender at the firewall level. This approach stops brute-force attacks before they succeed while allowing legitimate users to continue accessing your server.
Fail2Ban supports multiple firewall backends including iptables, nftables, and UFW. All current Debian versions default to iptables-multiport as the ban action, though you can configure nftables or UFW if your environment requires it. Additionally, Fail2Ban includes pre-configured jails for common services like SSH, Apache, Nginx, Postfix, and Dovecot, making initial setup straightforward for most server environments.
Update Debian Before Installing Fail2Ban
Before installing Fail2Ban, update your Debian operating system to ensure all existing packages are current. This step refreshes your package index and applies security patches so Fail2Ban installs on a stable foundation. Run the following command in your terminal:
sudo apt update && sudo apt upgrade -y
Install Fail2Ban from Debian Default Repositories
Fail2Ban lives in Debian’s default repositories, so no extra sources or third-party repositories are required. Install it with a single command:
| Debian Version | Fail2Ban Version | Python Version | Default Backend |
|---|---|---|---|
| Debian 13 (Trixie) | 1.1.0 | Python 3.12/3.13 | iptables-multiport |
| Debian 12 (Bookworm) | 1.0.2 | Python 3.11 | iptables-multiport |
| Debian 11 (Bullseye) | 0.11.2 | Python 3.9 | iptables-multiport |
sudo apt install fail2ban
This command pulls in Fail2Ban and its firewall backends so you can start protecting services immediately.
Confirm Fail2Ban Installation
After the installation completes, verify that Fail2Ban installed correctly by checking its version. This confirmation step ensures the package installed successfully before proceeding to configuration:
fail2ban-client --version
The output displays the installed version:
Fail2Ban v1.1.0
Debian 12 (Bookworm) shows version 1.0.2, and Debian 11 (Bullseye) shows version 0.11.2. Any of these versions confirms a successful installation and works with the configurations in this guide.
For additional verification, confirm Fail2Ban was installed from the official Debian repositories:
apt-cache policy fail2ban
The output shows the installed version and the repository source:
fail2ban:
Installed: 1.1.0-8
Candidate: 1.1.0-8
Version table:
*** 1.1.0-8 500
500 http://deb.debian.org/debian trixie/main amd64 Packages
100 /var/lib/dpkg/status
Verify Fail2Ban Service Status
After the installation, Fail2Ban should be active and enabled by default. Verify the service status to ensure it is running as expected:
systemctl status fail2ban
When running correctly, the output shows an active status:
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
Active: active (running) since Mon 2025-11-25 10:15:32 UTC; 5min ago
Docs: man:fail2ban(1)
Main PID: 1234 (fail2ban-server)
Tasks: 5 (limit: 4915)
Memory: 14.2M
CPU: 234ms
CGroup: /system.slice/fail2ban.service
└─1234 /usr/bin/python3 /usr/bin/fail2ban-server -xf start
If the service shows as inactive, start it and enable it on boot in a single step:
sudo systemctl enable --now fail2ban
This command starts Fail2Ban immediately and keeps it running after every reboot.
Install UFW (Optional)
If you prefer using Uncomplicated Firewall (UFW) with Fail2Ban instead of iptables, follow the steps below. UFW provides a user-friendly frontend to iptables and simplifies firewall rule management. Note that Debian omits UFW by default, so you must install it manually if you want this alternative firewall backend.
Install UFW
Install UFW on your Debian system with the following command:
sudo apt install ufw
Verify UFW Installation
After installing UFW, verify that the installation was successful by checking the installed version:
ufw version
The output displays the installed version:
ufw 0.36.2 Copyright 2008-2023 Canonical Ltd.
Enable UFW
Enable UFW on your system to activate the firewall and ensure it starts automatically when your Debian server boots. If you are connected over SSH, allow the service first so you do not lock yourself out:
sudo ufw allow OpenSSH
After allowing SSH (or other required services), turn on the firewall:
sudo ufw enable
This starts UFW and ensures it loads automatically when Debian boots. After running this command, you should see output similar to:
Firewall is active and enabled on system startup
This output confirms that UFW is active and will start automatically when your Debian server is rebooted.
Create a Safe Backup of Fail2Ban Configuration
After installing Fail2Ban, you will need to configure it to suit your server environment. Fail2Ban comes with two default configuration files located at /etc/fail2ban/jail.conf and /etc/fail2ban/jail.d/defaults-debian.conf. Before making any changes, create a backup copy to preserve your customizations across package updates.
Do not modify the default .conf files directly. Package updates overwrite them.
To preserve your custom settings, create copies of the configuration files with the .local extension. Fail2Ban prioritizes reading .local files over .conf files, so your customizations remain intact during package upgrades. By creating .local files, you ensure that your settings are not lost during updates, and you will always have a fresh copy to revert to in case of misconfiguration.
Create a Backup Configuration File (jail.local)
Execute the following command to create a working copy of the jail.conf file:
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
Now you have a working configuration file that Fail2Ban prioritizes over the default. Customize settings by editing jail.local without worrying about losing modifications during package updates.
Customize Fail2Ban Configuration for Your Server
After creating a backup of the original configuration file, adjust the settings in jail.local to meet your server’s specific security requirements. Jails are pre-configured protection rules that monitor specific services (SSH, Apache, Postfix, etc.) for attack patterns and automatically ban offending IPs when thresholds are exceeded. The configuration process involves selecting your firewall backend, setting ban times, whitelisting trusted IPs, and enabling jails for the services you run.
Choose Your Firewall Backend
Fail2Ban supports multiple firewall backends for banning IP addresses. All current Debian versions (11, 12, and 13) default to iptables-multiport as the ban action. However, you can explicitly configure nftables or UFW if your environment requires a different approach. Understanding the differences helps you choose the right backend:
| Backend | Status | Best For | Trade-offs |
|---|---|---|---|
| iptables | Default on all Debian versions | General use, mature tooling, widespread documentation | Older technology, might be deprecated in future releases |
| nftables | Available, not default | Modern systems, better performance with large rule sets, future-proof | Requires explicit configuration, nftables package must be installed |
| UFW | Manual install required | Desktop systems, simple firewall setups, user-friendly rule management | Extra package dependency, adds abstraction layer |
Configure nftables Backend
If you prefer nftables over iptables, add these settings to the [DEFAULT] section in your jail.local file:
[DEFAULT] # Switch to nftables (replaces iptables default) banaction = nftables-multiport banaction_allports = nftables-allports
Check which firewall subsystem your system uses by running nft list tables (nftables) or iptables -L (iptables). If you prefer UFW, see the dedicated section below. For firewalld users, Fail2Ban also includes firewalld actions. For most production servers, the default iptables backend works reliably without additional configuration.
Configure Log Backend for Systemd Journal
On Debian 12 and Debian 13, systems using systemd-journald for logging benefit from setting the backend to systemd. This configuration tells Fail2Ban to read logs directly from the systemd journal instead of polling traditional log files, which improves reliability and prevents startup issues on systems where log file paths differ or journald is the primary logging mechanism.
Add this setting to the [DEFAULT] section in jail.local to enable the systemd backend:
Systemd Journal Backend Configuration
[DEFAULT] # Use systemd journal backend (recommended for Debian 12+) backend = systemd
This backend setting is independent from the firewall banaction configuration shown above. The backend parameter controls how Fail2Ban reads logs, while banaction controls how it blocks IPs. Systems running Debian 12 or newer should use backend = systemd for better integration with journald, especially if you encounter startup failures or Fail2Ban reports that it cannot find log files.
Use the following examples as starting points. Every environment differs, so monitor logs and test changes to avoid false positives that could block legitimate users.
Editing the Configuration File
To edit the jail.local file using the nano editor, run the following command:
sudo nano /etc/fail2ban/jail.local
Enable Incremental Ban Times for Repeat Offenders
Enable the ban time increment setting to increase the ban duration for repeat offenders. This progressive penalty discourages persistent attackers by doubling the ban duration each time they trigger another offense. For example, you can double the ban each time an IP is caught repeatedly:
Ban Time Multiplier Configuration
## Ban time multipliers bantime.increment = true bantime.factor = 2 bantime.formula = ban.Time * (1<<(ban.Count if ban.Count<20 else 20)) * banFactor
These settings double the ban time for each subsequent offense, discouraging persistent attackers.
Whitelist IPs in Fail2Ban
To whitelist specific IP addresses, uncomment the ignoreip line and add the desired IP addresses, separated by spaces or commas. IP ranges can also be whitelisted.
IP Whitelist Configuration
ignoreip = 127.0.0.1/8 ::1 203.0.113.25 198.51.100.10
This example whitelists localhost, IPv6 loopback, and two trusted public addresses. Whitelist admin workstations or monitoring systems to prevent accidental bans.
Configure Default Ban Time and Thresholds
By default, Fail2Ban bans an attacker for 10 minutes after five failed attempts within a 10-minute window. These conservative defaults balance security with usability, preventing accidental lockouts while blocking automated attacks. You can adjust these default settings, but it is recommended to set custom ban times and retry limits for different jails based on service sensitivity:
Default Ban Thresholds
[DEFAULT] # "bantime" is the number of seconds that a host is banned. bantime = 10m # A host is banned if it has generated "maxretry" during the last "findtime" seconds. findtime = 10m # "maxretry" is the number of failures before a host get banned. maxretry = 5
In this example, the default settings ban an attacker for 10 minutes after five failed attempts in a 10-minute window. Adjust bantime, findtime, and maxretry to match your security posture. Consider increasing ban times for SSH (1-24 hours) while keeping shorter bans for web services where false positives are more likely.
Enable SSH Protection Jail
The SSH jail protects your server from brute-force login attempts targeting SSH, the most commonly attacked service on internet-facing servers. SSH attacks account for the majority of automated intrusion attempts because SSH provides root-level access when compromised. Debian’s default Fail2Ban configuration includes an sshd jail that monitors /var/log/auth.log for failed authentication attempts.
To enable SSH protection, locate the [sshd] section in jail.local and ensure it is enabled:
SSH Jail Configuration
[sshd] enabled = true port = ssh logpath = %(sshd_log)s backend = %(sshd_backend)s maxretry = 3 bantime = 1h findtime = 10m
In this example, the sshd jail bans IP addresses for 1 hour after 3 failed login attempts within a 10-minute window. Adjust maxretry, bantime, and findtime values based on your security requirements. Servers exposed to the public internet should enable this jail immediately after installation.
Configure Fail2Ban to Use UFW Instead of iptables
To configure Fail2Ban to use UFW as the default banning action instead of iptables, update the banaction line in the [DEFAULT] section.
UFW Backend Configuration
[DEFAULT] banaction = ufw
By changing the banaction value to ufw, Fail2Ban will use UFW to manage bans instead of iptables. This is useful if you already use UFW as your server’s primary firewall and want to maintain a consistent management system.
Configure Email Alerts and Notifications
Configure Fail2Ban to send email notifications with whois reports to a specified email address. Email alerts notify you immediately when attacks occur, helping you identify patterns and respond to security incidents. You can also set up different reporting options, such as sending emails to blacklist providers or the attacker’s ISP. Ensure an outbound mail service (Postfix, Exim, or an SMTP relay) is configured so alerts can leave the server.
Email Alert Configuration
destemail = root@yourdomain.com sender = fail2ban@yourdomain.com
In this example, root@yourdomain.com receives notifications, and fail2ban@yourdomain.com sends them. Email alerts keep you informed about security incidents so you can respond quickly.
Enable Additional Service Protection Jails
Beyond SSH protection, Fail2Ban includes jails for web servers, mail services, FTP daemons, and other network applications. Enable jails only for services you actually run on your server to avoid unnecessary log monitoring overhead. Each additional jail consumes system resources and increases log processing time, so configure only what you need.
To enable a jail, add “enabled = true” in the corresponding jail section. Below are common jails and their purposes:
Example: Protect Apache from Bad Bots
If you run Apache on your server, enable the apache-badbots jail to block malicious crawlers and bots:
[apache-badbots] enabled = true port = http,https logpath = %(apache_access_log)s bantime = 48h maxretry = 1
In this example, the apache-badbots jail bans offending IPs for 48 hours after a single detection. Enable only the jails that match the services on your server to balance coverage and performance.
You can also add custom actions or use actions from the action.d directory by updating the action line in the jail section.
Apache Botsearch Jail with Cloudflare Integration
[apache-botsearch]
enabled = true
port = http,https
logpath = %(apache_error_log)s
action = %(action_mw)s
cloudflare[auth_token=example_token, zone=example.com]
bantime = 72h
maxretry = 1
In this example, the apache-botsearch jail emails a warning and blocks the IP at Cloudflare. Replace the placeholder token and zone with your details before enabling a Cloudflare action.
Restart Fail2Ban Service
Once you have finished configuring Fail2Ban, restart the service to apply your changes:
sudo systemctl restart fail2ban
Ban and Unban IP Addresses Manually
Once Fail2Ban is configured, you can manage IP bans using the fail2ban-client command. Manual ban management lets you block known threats proactively or unban legitimate users who triggered false positives. You may need sudo privileges, depending on your setup.
Ban an IP Address Manually
To ban an IP address manually for a specific jail (e.g., apache-botsearch), use the following command:
sudo fail2ban-client set apache-botsearch banip <ip_address>
This command adds the specified IP address to the list of banned IPs for the apache-botsearch jail. As a result, the IP address will be blocked from accessing your server based on the rules defined in the jail. Manual bans persist until you remove them or restart the Fail2Ban service.
Unban an IP Address
To unban an IP address for a specific jail (e.g., apache-botsearch), use the following command:
sudo fail2ban-client set apache-botsearch unbanip <ip_address>
This command removes the ban for the specified IP address, allowing it to access your server again, assuming it complies with the rules in the apache-botsearch jail. Use this when you have confirmed the IP belongs to a legitimate user or service that was mistakenly banned.
Access the Help Menu
To access the help menu and view additional settings or commands, use the following command:
sudo fail2ban-client -h
Additional Management Examples
List enabled jails and summary:
sudo fail2ban-client status
The output lists all active jails:
Status |- Number of jail: 2 `- Jail list: apache-badbots, sshd
Check the status of a specific jail:
sudo fail2ban-client status sshd
The output shows current ban statistics for the jail:
Status for the jail: sshd |- Filter | |- Currently failed: 3 | |- Total failed: 47 | `- File list: /var/log/auth.log `- Actions |- Currently banned: 2 |- Total banned: 12 `- Banned IP list: 198.51.100.45 203.0.113.78
Reload the configuration without restarting the Fail2Ban service:
sudo fail2ban-client reload
This command reloads Fail2Ban’s configuration, applying any changes you made without restarting the service.
Check the list of currently banned IP addresses for a specific jail:
sudo fail2ban-client get apache-botsearch banned
This command lists all the IP addresses currently banned by the apache-botsearch jail.
These commands provide the tools to manage IP bans using Fail2Ban effectively. Replace <ip_address> with the actual IP you want to ban or unban, and swap apache-botsearch for the jail you want to manage.
Custom ban durations are configured in jail.local using the bantime parameter, not through the fail2ban-client command. To set different ban times for specific jails, add
bantime = 1h(or your preferred duration) to that jail’s configuration section.
Check and Monitor Fail2Ban Logs
Monitor and review Fail2Ban logs to ensure your jails are functioning correctly. By default, Fail2Ban logs can be found at /var/log/fail2ban.log.
Monitor Fail2Ban Logs in Real Time
To watch the logs live and spot any issues while working on your server, use tail -f:
tail -f /var/log/fail2ban.log
This command streams new log entries as they appear, helping you spot unusual activity or errors quickly.
Search Logs for Specific Information
You can also use the grep command to search for specific information within the logs, such as IP addresses, user agents, or errors. The grep command filters the log file and displays only the lines that contain the specified keyword.
Example user-agent:
grep "Bing" /var/log/fail2ban.log
This command searches for all log entries containing the word “Bing,” which might help you identify unwanted bot activity or user agents.
Example error:
grep "error" /var/log/fail2ban.log
This command searches for log entries containing the word “error,” helping you spot any issues or problems with Fail2Ban’s operation.
Example IP address:
grep "198.51.100.1" /var/log/fail2ban.log
This command searches for log entries containing the specified IP address, allowing you to track a specific IP’s activity or determine if it has been banned.
These examples demonstrate various ways to filter and search your logs using terminal commands. Regularly reviewing your Fail2Ban logs will help you maintain your server’s security and ensure your jails are working as intended.
Troubleshoot Fail2Ban Issues
If Fail2Ban is not working as expected, use these diagnostic commands to identify and resolve common issues.
Check Configuration Syntax
Before restarting Fail2Ban after making configuration changes, verify the syntax is correct:
sudo fail2ban-client -t
When the configuration is valid, you see:
OK: configuration test is successful
If errors exist, Fail2Ban displays the problematic file and line number:
ERROR: Failed during configuration: Bad jail name 'sshd'. Use 'filter = sshd' Error in FilterReader (reading filter configuration of jail 'sshd')
Fix the indicated syntax error and run the test again before restarting the service.
Test Filter Regex Patterns
If a jail is not detecting attacks, test the filter regex against the actual log file:
sudo fail2ban-regex /var/log/auth.log /etc/fail2ban/filter.d/sshd.conf
The output shows how many lines match the filter patterns:
Running tests ============= Use failregex filter file : sshd, basedir: /etc/fail2ban Use log file : /var/log/auth.log Use encoding : UTF-8 Results ======= Failregex: 47 total |- #) [# of hits] regular expression | 1) [47] ^\S+ sshd\[\d+\]: Failed .+ for .* from( port \d+)?( ssh\d?)?$ `- Ignoreregex: 0 total Date template hits: |- [# of hits] date format | [1823] {^LN-BEG}(?:DAY )?MON Day %k:Minute:Second(?:\.Microseconds)?(?: ExYear)? `- Lines: 1823 lines, 0 ignored, 47 matched, 1776 missed
A healthy result shows matched entries under “Failregex” (47 in this example). If zero matches appear but failed login attempts exist in the log, the filter regex may need adjustment or the log format differs from what the filter expects. Use the --print-all-matched flag to see exactly which lines triggered the filter.
View Detailed Jail Status and Ban Statistics
Check the detailed status of a specific jail to see current bans and failure counts. This status view helps you monitor attack patterns and verify that your jails are detecting threats correctly:
sudo fail2ban-client status sshd
The output displays current ban counts and the list of blocked IPs:
Status for the jail: sshd |- Filter | |- Currently failed: 1 | |- Total failed: 23 | `- File list: /var/log/auth.log `- Actions |- Currently banned: 3 |- Total banned: 8 `- Banned IP list: 198.51.100.45 203.0.113.78 192.0.2.100
“Currently failed” shows IPs approaching the ban threshold. “Currently banned” shows active bans. “Total” counts reflect all activity since the last service restart. Monitor these numbers regularly to identify attack trends and adjust thresholds accordingly.
Common Issues and Solutions
Jail fails to start: Check that the log file specified in logpath exists and is readable. Create the log file if missing, or disable the jail if the service is not installed.
Bans not working: Verify your firewall backend is installed and check that Fail2Ban created the rules properly. For iptables:
sudo iptables -L f2b-sshd -n
If you configured the nftables backend, verify the table exists:
sudo nft list table inet f2b-table
If the chain or table does not exist, confirm that banaction in jail.local matches your firewall backend (iptables-multiport, nftables-multiport, or ufw). Additionally, ensure the firewall service is running and configured to start on boot.
Too many false positives: Increase maxretry, extend findtime, or add legitimate IPs to ignoreip. Review the filter’s failregex to ensure it matches only actual attacks. Consider monitoring logs for a few days before enabling aggressive ban settings in production.
Database corruption after crash: If Fail2Ban fails to start with database errors like:
ERROR Failed to initialize database SQLite database is malformed
Remove the database file and restart:
sudo rm /var/lib/fail2ban/fail2ban.sqlite3
sudo systemctl restart fail2ban
Fail2Ban recreates the database automatically on startup. Existing bans are lost but the service resumes normal operation. To prevent database corruption, avoid forcibly killing the Fail2Ban process during normal operation.
Service fails to start after upgrade: Check the systemd journal for detailed error messages:
sudo journalctl -u fail2ban -n 50 --no-pager
This shows the last 50 log entries for Fail2Ban, revealing Python errors, permission issues, or configuration problems that prevent startup. Review these messages carefully when troubleshooting startup failures.
Remove Fail2Ban
In case you decide to remove Fail2Ban from your system, you can easily uninstall it by following these steps:
Stop and Disable the Fail2Ban Service
If the Fail2Ban service is still active, disable it first to ensure a smooth uninstallation process. Disabling the service prevents it from running in the background and interfering with removal.
Use the following command to disable the Fail2Ban service and stop it from running:
sudo systemctl disable fail2ban --now
This command disables the Fail2Ban service immediately (–now flag) and ensures it will not start automatically on future system reboots.
Uninstall Fail2Ban Package
After disabling the service, remove the Fail2Ban package:
sudo apt remove fail2ban
Next, remove orphaned dependencies that were installed automatically with Fail2Ban:
sudo apt autoremove
This cleans up packages like python3-systemd, python3-pyinotify, and other Python dependencies that Fail2Ban required but are no longer needed.
Remove Configuration Files and Database
The apt remove command leaves configuration files intact. To completely remove Fail2Ban including all configuration files, use purge instead:
sudo apt purge fail2ban
Warning: The following command permanently deletes the Fail2Ban database, which contains ban history, failure counts, and persistent ban records. This action cannot be undone. Only proceed if you no longer need this data.
To remove the Fail2Ban database directory:
sudo rm -rf /var/lib/fail2ban
Verify Removal
Confirm that Fail2Ban was completely removed by refreshing the package cache and checking the package status:
sudo apt update
apt-cache policy fail2ban
The output confirms the package is no longer installed:
fail2ban:
Installed: (none)
Candidate: 1.1.0-8
Version table:
1.1.0-8 500
500 http://deb.debian.org/debian trixie/main amd64 Packages
Conclusion
Installing Fail2Ban on Debian delivers immediate protection against brute-force attacks and automated intrusion attempts through intelligent log monitoring and firewall integration. The configuration process covers choosing between iptables, nftables, or UFW backends, enabling SSH protection for immediate security gains, customizing jail settings for Apache and other network services, configuring email alerts for security incident response, and managing bans manually when needed. Your Debian server now actively defends against unauthorized access attempts while maintaining flexible control over whitelist rules, progressive ban times, and service-specific thresholds that adapt to your security posture without blocking legitimate users.
Great tutorial, however your step to check if the fail2ban install went ok,”fail2ban –version”, throws a command not found error. “sudo fail2ban-client version” seems to be the correct form.
Checking the “systemctl status fail2ban” does work, once one has the jail.local correctly configured.
Again, great tutorial.
Thanks for catching that, RDK. You’re absolutely right, the version check command I provided was incorrect. The proper command is:
I’ve updated the “Confirm Fail2Ban Installation” section to use the correct syntax. The sudo prefix isn’t required for version checks since you’re just querying the client, not modifying system configuration. Thanks for testing the steps thoroughly and reporting the issue. Feedback like this helps keep the guide accurate for everyone.
Wow! Thanks a lot! I try to find the problem a lot of time!
Thanks for the feedback.
For D12, change “backend = auto” by “backend = systemd” in “/etc/fail2ban/jail.local” to make fail2ban start 😉
That’s great advice – just what I needed to overcome “code=exited, status=255/EXCEPTION” error.
Thanks to you, Steve and Joshua James for the article. Excellent!
Thanks for sharing this, Steve. You’re correct that on Debian 12, explicitly setting the backend to systemd in jail.local can resolve startup issues. Add this line to the [DEFAULT] section:
The systemd backend reads logs directly from the systemd journal instead of polling log files, which works more reliably on systems using journald. After adding this setting, restart Fail2Ban with systemctl restart fail2ban. Thanks for pointing this out for Debian 12 users.