(01)Install Fail2ban
Linux
1sudo apt-get install -y fail2ban2sudo systemctl enable fail2ban && sudo systemctl start fail2banBlock brute-force attacks by banning IPs
What is this?
Fail2ban automatically blocks IP addresses that try to brute-force your server.
Where to create or edit the main configuration — paths below match the setup steps.
/etc/fail2ban/jail.localLocation: Fail2ban server
Jail rules and ban settings (override jail.conf)
Step 01
1sudo apt-get install -y fail2ban2sudo systemctl enable fail2ban && sudo systemctl start fail2banStep 02
1sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local2sudo systemctl restart fail2banStep 03
1sudo fail2ban-client status2sudo fail2ban-client status sshd