Today im going to show how to configure Fail2ban on Centos 7 and block SSH attempts.
Install Fail2ban on CentOS 7
# sudo yum install epel-release
# systemctl enable fail2ban
Configure Local Settings
# nano /etc/fail2ban/jail.local
Paste the following:
/etc/fail2ban/jail.local
[sshd]
enabled = true
banaction = iptables-multiport
maxretry = 3
findtime = 43200
bantime = 86400
# sudo systemctl restart fail2ban
# fail2ban-client status sshd