安装软件
sudo yum install epel-release -y
sudo yum install fail2ban -y
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
编辑文件/etc/fail2ban/jail.local
[sshd]
enabled = true
port = 22
启动服务
sudo systemctl start fail2ban
sudo systemctl enable fail2ban
测试
tail -fn 400 /var/log/fail2ban.log