Fail2ban with iptables-services on CentOS7

Install fail2ban from EPEL repo.

  • Deal with SELinux, there are two options to choose from.
  • Update SELinux Policy
  • OR Disable SELinux
  1. Configure fail2ban, we prefer iptables-services here.

     

  2. Put the following lines in /etc/fail2ban/jail.d/sshd.local

Enable and start fail2ban.

 

LEAVE A COMMENT