SSH brute force protection that you can verify
Every server with SSH on a public address receives login attempts within minutes. SSH brute force protection is not only installing fail2ban: Avanguard checks that it is configured, that it reads the right log and that it really bans the addresses that attack you.
- Attack Scans, brute force, floods hit the server
- Detected in 15 s The agent reads logs and connections
- Blocked or explained Scanners blocked; AI writes the fix for the rest
- Verified Check again: the problem is gone
- Attack Scans, brute force, floods hit the server
- Detected in 15 s The agent reads logs and connections
- Blocked or explained Scanners blocked; AI writes the fix for the rest
- Verified Check again: the problem is gone
How an SSH brute force attack works
Automated tools try common usernames and passwords against port 22, one after another, all day long. Most attempts fail, but a single weak password, an old test account or a forgotten user without a password is enough to give someone a shell on your server.
The attempts end up in the SSH log as failed logins. The agent reads the new lines every 15 seconds and sends them aggregated, as failed logins per IP, so Avanguard sees the attack while it happens and opens a suggestion with its severity.
| Check | What Avanguard looks at | If it fails |
|---|---|---|
| Installed and running | fail2ban (or CrowdSec with bouncer, sshguard) is present and active | Install commands for your distribution |
| sshd jail | The jail for SSH is enabled | Configuration to enable it |
| Log readable | The jail reads a log that exists on the server | The right log path or backend |
| maxretry | At most 10 failures before a ban | A stricter value |
| Ban time | Bans last at least 5 minutes | A longer ban time |
| Effectiveness | Bans and failed logins per hour | Alert: fail2ban is not stopping an attacker |
Protect SSH from brute force with fail2ban
To protect SSH from brute force, Avanguard relies on the tool built for the job: fail2ban, which bans addresses after too many failures. CrowdSec with a firewall bouncer and sshguard are recognized too. The agent does not install anything: when something is missing, you get the commands prepared for your distribution and you run them.
A minimal /etc/fail2ban/jail.local looks like this: [sshd], enabled = true, maxretry = 5, bantime = 1h. Then sudo fail2ban-client status sshd shows the addresses currently banned.
fail2ban monitoring: is it really banning?
A fail2ban that runs but reads a log that does not exist, or whose jail is disabled, protects nothing and gives a false sense of safety. That is why fail2ban monitoring is part of the check: the agent follows the fail2ban log and the Protection tab shows bans and failed logins per hour, side by side.
If an address keeps failing without being banned, you receive the suggestion fail2ban is not stopping an attacker, with the explanation and the commands to fix the configuration.
Distributed brute force
Some attacks come from hundreds of addresses, each trying only a few passwords. Every single IP stays below the fail2ban threshold, so nothing is banned while the attack goes on. Avanguard also recognizes failed logins from many addresses together and reports a distributed brute force.
Against this kind of attack the real defence is not a stricter threshold but removing passwords from the game altogether.
Key-only SSH: the change that matters most
With key-only SSH a guessed password is useless. In /etc/ssh/sshd_config set PasswordAuthentication no and PermitRootLogin prohibit-password (or no), check that your key works in a second session, then reload SSH. Avanguard reports SSH root login and password login as findings among the vulnerabilities, and the hourly scan records new users and new SSH keys, so an unexpected key added to authorized_keys does not go unnoticed.
From failed logins to a protected server
- 1
Check
Avanguard verifies fail2ban and the SSH configuration at every full scan and follows failed logins every 15 seconds.
- 2
Fix
Run the commands prepared for your distribution: install, enable the jail, tighten the settings, switch to keys.
- 3
Verify
Check again in one click and watch bans per hour: failed logins must turn into bans.
Frequently asked questions
Does Avanguard install or configure fail2ban for me?
No. The agent never executes commands received from the network. Avanguard prepares the commands for your distribution and you run them, so you keep control of every change on the server.
Is fail2ban enough if I still use passwords?
It slows attackers down, but a distributed brute force can stay below its thresholds. Key-only SSH is the recommended setup; fail2ban then keeps the logs clean and stops the noise.
What about brute force on my web application?
Avanguard also reads the web server access logs and reports login brute force on your application, scans and floods. See attack protection for the full list, or how the agent collects the data on how it works.
Does it work with servers that run Docker?
Yes. The agent itself runs in a container and reads the host logs read-only. For the firewall side of Docker hosts see Docker server security.
More about Avanguard
- Attack protection SSH brute force, scans for secret files, HTTP and SYN floods, threat lists: detected live, scanners blocked automatically. Learn more →
- Vulnerabilities Vulnerable packages from the OSV database, missing updates, pending reboots, risky configs, external port and TLS checks. Learn more →
- Docker and Coolify Docker ports that bypass ufw, public Coolify databases, open Traefik dashboards and suspicious container connections. Learn more →
- Server monitoring CPU, memory, disk, network and HTTP traffic every 15 seconds, thresholds, disk full forecast and offline alerts. Learn more →
- AI assistant Explanations and fix commands written by AI for your server, and a browser terminal with a copilot that suggests the next step. Learn more →
- Compliance Findings mapped onto NIS2, GDPR, DORA, ISO 27001 and CIS, an incident kit with deadlines and verifiable attestations. Learn more →
Know what is happening on your servers, today
Create your account, run one Docker command and in a few minutes you see attacks, vulnerabilities and resources of the server, with the commands to fix what matters.
Already have an account? Sign in · Documentation