How to ban an IP address in Fail2Ban
Identify the jail you want to apply the ban to:
sudo fail2ban-client status
Run the following command, replacing with the jail’s name (e.g., sshd) and with the IP you want to block:
sudo fail2ban-client set banip
Check if the IP is now listed under the banned IP list for that jail:
sudo fail2ban-client status