Hostxpeed
Login Get Started →
Security

How to Enable Fail2ban

4 min read
31 views
Jun 10, 2026

Prerequisites

  • Root or sudo user
  • SSH access

Step 1: Install Fail2ban

sudo apt update && sudo apt install fail2ban -y

Step 2: Start and Enable Service

sudo systemctl start fail2ban
sudo systemctl enable fail2ban

Step 3: Check Status

sudo fail2ban-client status

Step 4: View SSH Jail Status

sudo fail2ban-client status sshd

Fail2ban automatically bans IPs after repeated failed login attempts.

Was this article helpful?