| 用途 | 自动检测并临时封禁暴力破解来源 |
|---|---|
| 语法 | fail2ban-client 管理 / /etc/fail2ban/ 配置 |
| 所属 | fail2ban 软件包 |
最小可用配置
最小可用配置
# /etc/fail2ban/jail.d/sshd.local
[sshd]
enabled = true
port = ssh
maxretry = 5
findtime = 10m
bantime = 1h
banaction = iptables-multiport管理命令
管理命令
systemctl enable --now fail2ban
fail2ban-client status sshd
fail2ban-client set sshd unbanip 203.0.113.10
journalctl -u fail2ban -n 50banaction 要与你实际防火墙匹配(iptables/firewalld/nftables);云环境安全组与 fail2ban 双保险更稳。