Menu Close

How To Protect SSH With Fail2Ban on CentOS 7

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

# yum install fail2ban



# 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

%d bloggers like this: