Skip to main content

CentOS 7 安装 fail2ban

sudo yum install epel-release
sudo yum install fail2ban
sudo systemctl enable fail2ban
sudo nano /etc/fail2ban/jail.local
[DEFAULT]
[DEFAULT]
# Ban hosts for one hour:
bantime = 3600

# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport

[sshd]
enabled = true
sudo systemctl restart fail2ban
sudo fail2ban-client status
sudo fail2ban-client status sshd