
Wordpress 使用 Fail2ban 防止密碼破解
本文目錄共 6 節
測試環境
- CentOS 7
- Nginx 1.12.2
尚未安裝Fail2ban 請參考 Fail2ban 防止 SSH 密碼嘗試攻擊
本篇就著重在Fail2ban設定
1.新增判斷模組
預設檔案位置
/etc/fail2ban/filter.d/wp-login.conf
檔案內容
failregex = ^<HOST> - - .*(POST|GET)\ .*wp-login.php.*
ignoreregex =
2.添加至條件至jail.local
預設路徑
/etc/fail2ban/jail.local
添加檔案內容
enabled = true
port = http,https
filter = wp-login
logpath = /var/log/nginx/access.log
maxretry = 10
findtime = 600
bantime = 3600
3.重新啟動
sudo systemctl restart fail2ban
參考來源
收錄於「#Security」系列手札

獨立技術專刊推播
訂閱技術電子報
有新文章發布時寄送到您的信箱,不發送垃圾信。