Skip to content

Block brute-force attacks with fail2ban

Any public server gets a steady stream of bots trying to guess SSH and login passwords. fail2ban watches your logs and automatically bans an IP after too many failures — and OrbixPanel installs it for you at setup.

What fail2ban does

It tails log files, and when an IP racks up repeated failed logins in a short window, it adds a temporary firewall ban. The attacker’s automated script moves on; your real logins are unaffected.

Check it’s running

In the web terminal or over SSH:

Terminal window
sudo fail2ban-client status # lists active jails (e.g. sshd)
sudo fail2ban-client status sshd # banned IPs for the SSH jail

The concepts (if you tune it)

SettingMeaning
maxretryfailures allowed before a ban
findtimethe window those failures must happen in
bantimehow long the ban lasts (can escalate for repeat offenders)

Defaults are sensible; only change them if you have a specific reason.

Don’t ban yourself

  • Logging in with a wrong password several times can ban your own IP. If you get locked out of SSH, you can unban from the panel or console:
    Terminal window
    sudo fail2ban-client set sshd unbanip YOUR.IP.ADDRESS
  • Better: use SSH keys so you’re not typing passwords at all.

Layer your defenses

fail2ban is one layer. Combine it with:


Running OrbixPanel? fail2ban is installed and protecting SSH out of the box. OrbixPanel.com → — the free, self-hosted, AI-powered hosting control panel.