1. Install: sudo apt install fail2ban or sudo yum install fail2ban

  2. Copy default config: sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

  3. Edit jail.local and enable sshd protection

  4. Start Fail2Ban: sudo systemctl start fail2ban

  5. Enable at boot: sudo systemctl enable fail2ban

Fail2Ban automatically blocks IPs after repeated failed login attempts.

Was this answer helpful? 0 Users Found This Useful (0 Votes)