curl -sL https://raw.githubusercontent.com/ai7778/ssh/main/f2b_set_port.sh | sudo bash

把你自己的 IP 加入白名单

nano /etc/fail2ban/jail.local

后面加你的公网 IP,空格分隔

ignoreip = 127.0.0.1/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 1.2.3.4

重启

systemctl restart fail2ban
最后修改:2026 年 05 月 04 日
如果觉得我的文章对你有用,请随意赞赏