2014-04-20 // fail2ban: geblockte IP-Adressen entsperren
Hin und wieder kommt es vor, dass eine gesperrte IP-Adresse in fail2ban wieder freigeschaltet werden soll. Das Tool fail2ban-client
sagt dazu:
$ fail2ban-client -h Usage: /usr/bin/fail2ban-client [OPTIONS] <COMMAND> Fail2Ban v0.8.6 reads log file that contains password failure report and bans the corresponding IP addresses using firewall rules. (...) get <JAIL> actionunban <ACT> gets the unban command for the action <ACT> for <JAIL> (...)
D.h. ich beziehe über folgenden Befehl den passenden Befehl um den Clienten/die IP zu entbannen:
$ fail2ban-client get <JAIL> actionunban <ACT>
<JAIL>
und <ACT>
können, falls nicht bekannt durch die folgenden Befehle bestimmt werden:
$ sudo fail2ban-client status # Bestimmung von <JAIL>: Status/Liste aller aktiven Jails $ sudo iptables -L # Bestimmung von <ACT>: zeigt die Chains und Rules von iptables an
<ACT>
müsste normalerweise iptables-multiport
sein. Für den Jail apache
ergibt sich nun folgende Ausgabe:
$ sudo fail2ban-client get apache actionunban iptables-multiport iptables -D fail2ban-<name> -s <ip> -j DROP
Mit <name>
wird der Jail bezeichnet. Somit kann ich den Client mit der IP <ip>
wie folgt entsperren:
$ sudo iptables -D fail2ban-apache -s <ip> -j DROP
Leave a comment…
- E-Mail address will not be published.
- Formatting:
//italic// __underlined__
**bold**''preformatted''
- Links:
[[http://example.com]]
[[http://example.com|Link Text]] - Quotation:
> This is a quote. Don't forget the space in front of the text: "> "
- Code:
<code>This is unspecific source code</code>
<code [lang]>This is specifc [lang] code</code>
<code php><?php echo 'example'; ?></code>
Available: html, css, javascript, bash, cpp, … - Lists:
Indent your text by two spaces and use a * for
each unordered list item or a - for ordered ones.