linux安装fail2ban 防止SSH密码爆破

yum update -y
安装
yum install fail2ban -y
启用
systemctl enable fail2ban
打开配置文件
vim /etc/fail2ban/jail.local
在配置文件中添加以下内容
[DEFAULT]
# Ban hosts for one hour:
bantime = 43200
findtime = 600
maxretry = 1

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

[sshd]
enabled = true

----------------------
重启fail2ban
systemctl restart fail2ban

查看fail2ban状态
fail2ban-client status
fail2ban-client status sshd

你可能感兴趣的:(Linux)