Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[ssh/iptables] bloquear IP segun intentos fallidos (SOLVED)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Spanish
View previous topic :: View next topic  
Author Message
nandelbosc
Guru
Guru


Joined: 29 Sep 2004
Posts: 350
Location: olot

PostPosted: Tue Apr 08, 2008 3:50 pm    Post subject: [ssh/iptables] bloquear IP segun intentos fallidos (SOLVED) Reply with quote

Buenas,

estoy seguro que se puede, asi que ni lo pregunto... ;-)

¿como puedo hacer que al cabo de 3 o 4 intentos seguidos y fallidos de acceso a mi server SSH se añada automaticamente una regla a IPTABLES impidiendo el acceso a cualquier puerto desde esa IP?

La idea seria usar (si es posible) un simple script, sin tener que usar demasiados paquetes y sobretodo sin tener que reiniciar el server ;-) ...

el ciruito seria algo asi...
Code:
...
Apr  8 17:26:00 vito sshd[20135]: Failed password for root from 201.116.211.84 port 45418 ssh2
Apr  8 17:26:05 vito sshd[20140]: Failed password for root from 201.116.211.84 port 46089 ssh2
Apr  8 17:26:09 vito sshd[20147]: Failed password for root from 201.116.211.84 port 46654 ssh2
Apr  8 17:26:13 vito sshd[20152]: Failed password for root from 201.116.211.84 port 47334 ssh2
...
-A INPUT -s 201.116.211.84 -j DROP
-A INPUT -d 201.116.211.84 -j DROP
...
iptable-restore /etc/iptables
...


gracias de antemano!


Last edited by nandelbosc on Tue Apr 08, 2008 5:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
opotonil
l33t
l33t


Joined: 17 Jun 2005
Posts: 801
Location: 127.0.0.1

PostPosted: Tue Apr 08, 2008 5:14 pm    Post subject: Reply with quote

Si no recuerdo mal para eso estaba por ejemplo el fail2ban (http://gentoo-wiki.com/HOWTO_fail2ban) y si buscas por el foro encontraras bastante informacion sobre el tema, scripts, etc.

Salu2
Back to top
View user's profile Send private message
nandelbosc
Guru
Guru


Joined: 29 Sep 2004
Posts: 350
Location: olot

PostPosted: Tue Apr 08, 2008 5:54 pm    Post subject: Reply with quote

Con fail2ban es realemente senzillo!

http://gentoo-wiki.com/HOWTO_fail2ban

Gracias!
Back to top
View user's profile Send private message
Annagul
Apprentice
Apprentice


Joined: 05 Dec 2004
Posts: 156
Location: San Fernando, Cádiz (Spain)

PostPosted: Tue Apr 08, 2008 6:41 pm    Post subject: Reply with quote

También puedes probar app-admin/denyhosts.
_________________
Sapere aude
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Spanish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum