#install
sudo dnf install epel-release –y
sudo dnf install fail2ban –y
systemctl status fail2ban.service

#configuration
/etc/fail2ban
cp jail.conf jail.local
in nginx section enable: enabled = true

#system restart
sudo systemctl enable fail2ban
activating fail2ban: sudo systemctl enable fail2ban

#start
start: systemctl start fail2ban


#checking status
check client status: fail2ban-client status
detail status: fail2ban-client status nginx-http-auth

#how to unban an ip address?
fail2ban-client set nginx-http-auth unbanip 188.22.34.13

#want more log files?
fail2ban log file: /var/log/fail2ban.log


--------
see also
- https://www.digitalocean.com/community/tutorials/how-to-protect-an-nginx-server-with-fail2ban-on-rocky-linux-9

computer2know :: thank you for your visit :: have a nice day :: © 2024