Dimensione: 2223
Commento:
|
Dimensione: 2386
Commento:
|
Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
Linea 9: | Linea 9: |
1 Istallazione | == 1 Istallazione == |
Linea 13: | Linea 13: |
apt-get install python python2.3-dev python2.3 |
{{{ apt-get install python python2.3-dev python2.3 |
Linea 21: | Linea 21: |
}}} | |
Linea 24: | Linea 25: |
2 Configurazione | == 2 Configurazione == |
Linea 26: | Linea 27: |
{{{ | |
Linea 28: | Linea 30: |
}}} |
|
Linea 35: | Linea 39: |
{{{ | |
Linea 37: | Linea 42: |
}}} Servirà anche daemon control quindi: {{{ |
|
Linea 38: | Linea 48: |
}}} |
|
Linea 39: | Linea 51: |
{{{ |
|
Linea 42: | Linea 56: |
}}} |
|
Linea 45: | Linea 61: |
{{{ |
|
Linea 47: | Linea 65: |
}}} |
|
Linea 48: | Linea 68: |
{{{ |
|
Linea 51: | Linea 73: |
}}} |
|
Linea 52: | Linea 76: |
{{{ |
|
Linea 53: | Linea 79: |
}}} |
|
Linea 54: | Linea 82: |
{{{ |
|
Linea 55: | Linea 85: |
}}} |
Prevenire attacchi brute-force con dizionario - DenyHosts
Tratto dall’articolo di: Falko Timme <ft [at] falkotimme [dot] com> URL: http://www.howtoforge.com/preventing_ssh_dictionary_attacks_with_denyhosts Traduzione: ac3bf1
In questo HowTo si discuteranno i passaggi per installare DenyHosts su una macchina Linux. DenyHosts è un tool che osserva i login via SSH, e se trova dei login non andati a buon fine dallo stesso IP, DenyHosts blocca ogni successivo tentativo di accesso da quel indirizzo IP inserendolo in /etc/hosts.deny. In questo tutorial DenyHosts sarà installato ed eseguito come daemon.
1 Istallazione
Per compilare ci servira pithon2.3-dev su Debian.
apt-get install python python2.3-dev python2.3 cd /tmp wget http://mesh.dl.sourceforge.net/sourceforge/denyhosts/DenyHosts-2.0.tar.gz tar –xzvf DenyHosts-2.0.tar.gz cd DenyHosts-2.0 python setup.py install
Questa procedura scaricherà DenyHosts in /tmp, e lo installerà in /usr/share/denyhosts
2 Configurazione
cd /usr/share/denyhosts cp denyhosts.cfg-dist denyhosts.cfg
edita denyhosts.cfg (vi denyhosts.cfg) file esempio qui
attenzione a SECURE_LOG e LOCK_FILE sono molto importanti
per Debian sono:
SECURE_LOG = /var/log/auth.log LOCK_FILE = /var/run/denyhosts.pid
Servirà anche daemon control quindi:
cp daemon-control-dist daemon-control
edita daemon-control (vi daemon-control) facendo attenzione a DENYHOSTS_BIN, DENYHOSTS_LOCK, and DENYHOSTS_CFG. Per Debian sono le seguenti:
DENYHOSTS_BIN = "/usr/bin/denyhosts.py" DENYHOSTS_LOCK = "/var/run/denyhosts.pid" DENYHOSTS_CFG = "/usr/share/denyhosts/denyhosts.cfg"
File di esempio qui
Ora bisogna rendere il file eseguibile:
chown root daemon-control chmod 700 daemon-control
Per creare lo script di avvio:
cd /etc/init.d ln -s /usr/share/denyhosts/daemon-control denyhosts update-rc.d denyhosts defaults
e infine lo avvimao:
/etc/init.d/denyhosts start
Per attivare la variabile PURGE_DENY del file denyhosts.cfg utilizzare la seguentestringa per l’avvio:
/etc/init.d/denyhosts start --purge
Vi consiglio di configurare I parametric per la posta in denyhosts.cfg per ricevere notifica di attacchi. DenyHosts: http://denyhosts.sourceforge.net ac3bf1