Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
debian:hosts.deny [2016/05/03 00:17] – modification externe 127.0.0.1 | debian:hosts.deny [2022/11/08 16:43] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Remove a host that denyhosts has banned ====== | ||
+ | |||
+ | **Denyhosts** is a utility that automatically bans IPs who attempt to ssh in to your server and get three wrong passwords. | ||
+ | This is great when people are dictionary-attacking your **SSH server**, but less good when you have actual users who might get their //password wrong// | ||
+ | |||
+ | < | ||
+ | #/bin/sh | ||
+ | REMOVE=$1 | ||
+ | |||
+ | service denyhosts stop | ||
+ | |||
+ | cd / | ||
+ | |||
+ | for THISFILE in hosts hosts-restricted hosts-root hosts-valid users-hosts; | ||
+ | do | ||
+ | mv $THISFILE /tmp/;cat / | ||
+ | done | ||
+ | |||
+ | mv / | ||
+ | cat / | ||
+ | rm / | ||
+ | |||
+ | service denyhosts start | ||
+ | </ | ||
+ | |||
+ | Needs to run as //root//. | ||
+ | |||
+ | OR | ||
+ | |||
+ | < | ||
+ | |||
+ | #/bin/sh | ||
+ | REMOVE=$1 | ||
+ | |||
+ | service denyhosts stop | ||
+ | |||
+ | cd / | ||
+ | |||
+ | for THISFILE in hosts hosts-restricted hosts-root hosts-valid users-hosts; | ||
+ | do | ||
+ | mv $THISFILE /tmp;cat / | ||
+ | done | ||
+ | |||
+ | mv / | ||
+ | cat / | ||
+ | rm / | ||
+ | |||
+ | service denyhosts | ||
+ | </ | ||
+ | |||
+ | Source: | ||
+ | |||
+ | {{tag> |