Use it when configuring, checking or troubleshooting Fail2ban in Linux Security.
Fail2ban
Fail2ban parses configured log sources for repeated matching failures and invokes actions such as temporary firewall bans, reducing automated abuse from source addresses without replacing authentication hardening or application security.
1. Fail2ban bans IPs after repeated failures (SSH, web).
2. Reduces brute-force noise.
3. Not a replacement for key auth/MFA.
4. Whitelist admin IPs.
5. Uses nftables/iptables actions.
log failures → jail threshold → ban
Context & applicabilityCommon mistakes · platform/version boundaries
A ban shows matching log events crossed configured thresholds for a source, but it does not show the source is malicious or other addresses/accounts are safe.
Suspicious evidence: wrong log backend, filter no longer matches, proxy address banned, IPv6 gap, firewall action backend mismatch, allowlist too broad, distributed attack bypass or ban mistaken for account protection.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
application authentication event → log/journal source → filter/failregex → counter/find time → ban action/firewall state → expiry/unban → service outcome
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Fail2ban ban ≠ attacker identity or account compromise prevented.
- Service running ≠ jail reads the correct current log source and applies actions.
- Configuration file present ≠ parsed, loaded and effective runtime state.
- One allow/deny result ≠ complete DAC, privilege, LSM, firewall and application outcome.
fail2ban-client status— jailsfail2ban-client status sshd— banned IPsjournalctl -u fail2ban --since -1h— actions
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
A ban shows matching log events crossed configured thresholds for a source, but it does not show the source is malicious or other addresses/accounts are safe.
In depth
Fail2ban scans logs for repeated authentication failures and temporarily bans offending IP addresses with firewall rules. It reduces brute-force noise against SSH, web logins and mail services.
# /etc/fail2ban/jail.local
[sshd]
enabled = true
maxretry = 5
findtime = 10m
bantime = 1h
ignoreip = 127.0.0.1/8 10.0.10.0/24
fail2ban-client status sshd
fail2ban-client set sshd unbanip 203.0.113.50
Fail2ban is a useful extra layer, not a primary control: key-only SSH authentication, MFA and restricting SSH to management networks matter more. Distributed attacks from many IPs are not stopped by per-IP bans.
ReferenceConfiguration & state1 section · depth on demand
Configuration
# /etc/fail2ban/jail.local
[sshd]
enabled = true
maxretry = 5
findtime = 10m
bantime = 1h
ignoreip = 127.0.0.1/8 10.99.0.0/24
Documented example, not captured output. fail2ban-client status sshd shows banned IPs; fail2ban-client set sshd unbanip <ip> unbans. It slows brute force from single IPs but not distributed attacks; key-only SSH and MFA matter more.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Linux Security → Fail2ban. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.kernel.org/security/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Linux Security → Fail2ban proof map
Fast scope, effective-state, runtime-evidence and closure boundaries for Linux Security → Fail2ban.
| Boundary | Establish | Does not establish |
|---|---|---|
| Scope | Exact host, role, build/kernel, identity, workload and expected control | Does not prove policy receipt or effective runtime state |
| Effective state | Resultant/loaded policy, precedence, mode, labels/rules/keys and active services/kernel controls | Configuration presence does not prove enforcement |
| Runtime evidence | Correlated events/audit, process/token/credential, packet/syscall and workload result | One event, clean status or allow/deny does not prove complete security |
| Closure | Original allowed/denied workload works, unsafe state is removed and recovery/regression pass | Commit, restart, block or compliance result alone is not closure |