58 字
1 分钟
Fail2ban防护
2026-06-24
Fail2ban防护
sudo apt install -y fail2ban写配置
sudo tee /etc/fail2ban/jail.d/sshd.local > /dev/null <<'EOF'[DEFAULT]bantime = 1dfindtime = 10mmaxretry = 5banaction = nftables
[sshd]enabled = truebackend = systemdport = 22EOF启用并检查
sudo systemctl enable --now fail2bansudo fail2ban-client statussudo fail2ban-client status sshd