ExplorerPatcher完全指南:5分钟让Windows 11回归经典操作体验
2026/7/8 15:08:12
sudo systemctl start fail2bansudo systemctl stop fail2bansudo systemctl restart fail2bansudo systemctl status fail2bansudo systemctl enable fail2bansudo fail2ban-client statussudo fail2ban-client status sshdsudo fail2ban-client set [监狱名] banip [目标IP]sudo fail2ban-client set sshd banip 10.0.0.1(封禁 10.0.0.1 到 sshd 监狱)sudo fail2ban-client set [监狱名] unbanip [目标IP]sudo fail2ban-client set sshd unbanip 10.0.0.1sudo fail2ban-client unban --allbash
运行
sudo tee /etc/fail2ban/jail.d/sshd.conf <<-'EOF' [sshd] enabled = true # 启用监狱 port = ssh # 防护端口(ssh 对应 22) filter = sshd # 匹配 sshd 日志的规则 backend = systemd # 适配 Ubuntu 新版日志机制 maxretry = 3 # 3 次失败登录触发封禁 bantime = 3600 # 封禁时长(秒),1 小时=3600 秒 findtime = 600 # 统计窗口(秒),10 分钟内触发 ignoreip = 127.0.0.1 # 忽略本地 IP,避免误封 action = iptables-multiport # 封禁动作(iptables 拦截) EOFsudo fail2ban-client reload sshdsudo systemctl restart fail2bancd /var/www/f2bwi && php -S 127.0.0.1:8080Ctrl+C终止进程http://127.0.0.1:8080bash
运行
sudo sed -i '1i <?php error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); ?>' /var/www/f2bwi/index.phpbackend = systemd,否则日志匹配失败;/var/log/auth.log无效,优先用ssh输错密码或banip命令测试;systemctl status fail2ban),确保服务正常运行。