差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 | |||
| tech:fail2ban_unban [2016/04/06 13:24] – jonathan | tech:fail2ban_unban [2019/01/02 13:33] (目前版本) – [將特定 IP 列入白名單] Jonathan Tsai | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== 手動解除 fail2ban 封鎖的 IP ====== | ||
| + | 因為常常發現更換密碼後, | ||
| + | |||
| + | * 假設以下是已經被 ban 的 iptables 清單< | ||
| + | iptables --list | ||
| + | </ | ||
| + | Chain INPUT (policy ACCEPT) | ||
| + | target | ||
| + | fail2ban-SSH | ||
| + | fail2ban-dovecot | ||
| + | fail2ban-dovecot-auth | ||
| + | fail2ban-sendmail-smtp | ||
| + | ACCEPT | ||
| + | ACCEPT | ||
| + | : | ||
| + | : | ||
| + | Chain fail2ban-dovecot-auth (1 references) | ||
| + | target | ||
| + | RETURN | ||
| + | |||
| + | Chain fail2ban-sendmail-smtp (1 references) | ||
| + | target | ||
| + | REJECT | ||
| + | REJECT | ||
| + | RETURN | ||
| + | </ | ||
| + | * 打算將 fail2ban-sendmail-smtp 內 192.168.0.120 手動解除封鎖 | ||
| + | |||
| + | ===== 正規功能 ===== | ||
| + | * 並沒有成功.. 應該是要定義 action unban 的作用功能 <code sh> | ||
| + | fail2ban-client get sendmail-smtp actionunban 192.168.0.120 | ||
| + | </ | ||
| + | ERROR NOK: (' | ||
| + | ' | ||
| + | </ | ||
| + | |||
| + | ===== iptables 命令 ===== | ||
| + | * 有成功.. <code sh> | ||
| + | iptables -D fail2ban-sendmail-smtp 1 | ||
| + | iptables --list | ||
| + | </ | ||
| + | : | ||
| + | : | ||
| + | Chain fail2ban-sendmail-smtp (1 references) | ||
| + | target | ||
| + | REJECT | ||
| + | RETURN | ||
| + | </ | ||
| + | |||
| + | ===== 將特定 IP 列入白名單 ===== | ||
| + | * 因為特殊原因, | ||
| + | * Exp. 將 127.0.xx.xx 以及 192.168.0.124 加入白名單< | ||
| + | : | ||
| + | [DEFAULT] | ||
| + | |||
| + | # " | ||
| + | # ban a host which matches an address in this list. Several addresses can be | ||
| + | # defined using space separator. | ||
| + | ignoreip = 127.0.0.1/8 192.168.0.124/ | ||
| + | |||
| + | : | ||
| + | </ | ||
| + | * 重新載入讓設定生效< | ||
| + | service fail2ban reload</ | ||
| + | |||
| + | < | ||
| + | ** 在 iRedMail 內建的 fail2ban 需要更改的檔案 jail.local ** | ||
| + | </ | ||
| + | ===== 參考網址 ===== | ||
| + | * https:// | ||
| + | |||
| + | {{tag> | ||