Prerequisites
- Root or sudo user
- SSH access
Step 1: Install Fail2ban
sudo apt update && sudo apt install fail2ban -yStep 2: Start and Enable Service
sudo systemctl start fail2ban
sudo systemctl enable fail2banStep 3: Check Status
sudo fail2ban-client statusStep 4: View SSH Jail Status
sudo fail2ban-client status sshdFail2ban automatically bans IPs after repeated failed login attempts.