Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Sep 18, 2004 6:43 am 
Offline
Senior Newbie

Joined: Sun Apr 18, 2004 3:30 am
Posts: 19
Hi,

How do I block an IP address after x number of failed ssh login attempts? Any scripts handy I can just plug right in? It'd be great to be able to get an email upon such incident as well...

thanks....


Top
   
PostPosted: Sun Sep 19, 2004 3:21 am 
Offline
Junior Member

Joined: Wed Jul 21, 2004 4:45 am
Posts: 21
Website: http://www.percederberg.net
Location: Stockholm, Sweden
I haven't got anything handy for automatically blocking IPs, but if you want to be warned about invalid login attempts try installing and configuring a log monitor. I'm using Tenshi on Gentoo, but there are several others as well.

If you are worried about attacks to ssh, consider configuring it with certificates or create a "double protection" solution with port knocking. The latter way, all IPs not sending the right knocking sequence are blocked. See http://www.zeroflux.org/knock/ for a simple server & client.


Top
   
 Post subject:
PostPosted: Sun Sep 19, 2004 4:00 pm 
Offline
Senior Member
User avatar

Joined: Sat Jan 03, 2004 7:34 pm
Posts: 71
Website: http://www.darkforestmud.net
AOL: asura02003
Location: Oregon
I disabled the ability for root to SSH in (I can still SSH in and then SU to root if needed). I also have portsentry installed, which detects any port scans and blocks the IP via iptables.


Top
   
 Post subject:
PostPosted: Mon Sep 20, 2004 1:58 pm 
Offline
Senior Newbie

Joined: Sun Apr 18, 2004 3:30 am
Posts: 19
Thanks for the tips... I am going to force myself to live without root login and just do su then... In the meantime, I will investigate on Tenshi as well... Thanks!


Top
   
 Post subject:
PostPosted: Mon Sep 20, 2004 2:22 pm 
Offline
Senior Member
User avatar

Joined: Fri Aug 15, 2003 2:15 pm
Posts: 111
Website: http://fubegra.net/
You can also switch to using RSA keys instead of passwords. In the sshd_config file, you can use PermitRootLogin without-password, in conjunction with a /root/.ssh/authorized_keys file, to allow root access using the RSA key only. I've gone even further and only allow RSA for any connections, root or non-root.

It's not a bad idea to check the sshd and sshd_config man pages to see the available options.

_________________
Bus error (passengers dumped)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group