Today im going to show how to configure Fail2ban on Centos 7 and block SSH attempts.
Install Fail2ban on CentOS 7
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQm8ysll8ICJIqB8fcA2znaWqE48UTdxyz0Plhp1uqKRH0t_EtdydVWFF3FtcJLg4EfABKBZ3nJIO-5C-OgmEfqzE6N8mzG5qzlLOhNDIHXBkJLa-E8wFgUZYlEI05LlYUPyLD255l9s4/s640/Screen+Shot+2019-07-08+at+4.19.55+PM.png)
# 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