Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu May 07, 2009 1:19 pm 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
Hi guys,

I was looking at my auth.log attempt today, and oh boy, for only 3 not known web site I got alot of root attempts.

Is there an easy way to block ip addresses if they fail more than 3 times to authenticate ssh?

thank you !
Cedric


Top
   
 Post subject:
PostPosted: Thu May 07, 2009 1:30 pm 
Offline
Senior Newbie

Joined: Thu Apr 23, 2009 5:00 pm
Posts: 15
apt-get install denyhosts

(For Debian and Debian-based distros...)


Top
   
 Post subject:
PostPosted: Thu May 07, 2009 1:47 pm 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
yah im on ubuntu 9.04

Thank you!


Top
   
 Post subject:
PostPosted: Thu May 07, 2009 3:44 pm 
Offline
Senior Member
User avatar

Joined: Fri Jan 02, 2009 11:31 am
Posts: 141
Website: http://faroutscience.com
Location: Texas / Kansas
Check sshd_config:

PermitRootLogin no (then use su or su - to gain root privaleges)

MaxAuthTries 3 (drops the connection after 3 login failures)

This is just a basic start at ssh security.

As others mentioned, I have had good luck denyhost

Jeff


Top
   
 Post subject:
PostPosted: Thu May 07, 2009 9:30 pm 
Offline
Senior Member
User avatar

Joined: Mon Jul 21, 2008 1:26 pm
Posts: 171
Website: http://www.rejecttheherd.net
Location: Seattle
Allowing remote root access is a really, really bad idea. Do yourself a favor and disable all remote root access, create a user with a really obscure name. Then just make sure they belong in the "wheel" group so you can just su over once logged in.

Then I would go even further and lock down ssh access by IP if at all possible. ;)

_________________
Image
Where "Thought Crime" is commited
http://www.rejecttheherd.net


Top
   
 Post subject:
PostPosted: Fri May 08, 2009 12:17 am 
Offline
Senior Member

Joined: Sat Dec 04, 2004 5:36 pm
Posts: 145
marcus0263 wrote:
Allowing remote root access is a really, really bad idea. Do yourself a favor and disable all remote root access, create a user with a really obscure name. Then just make sure they belong in the "wheel" group so you can just su over once logged in.

Then I would go even further and lock down ssh access by IP if at all possible. ;)


Ways to be safer:

1) sshd on an alternate port
2) disable password-based logins and allow only passphrase-based logins
3) use of sudo to gain root access instead of su might be better since it gives you more fine-grained control and also doesn't require you to be in wheel (wheel can be dangerous or a risk at times if ever compromised)
4) use of two-factor authentication. SecurID is common but really expensive. There's cheaper stuff for small scale setups, but can't remember what I looked at now.

I'm not fond of idea of having a separate login to use to become root because it's too easy to overlook any compromise attempts (successful or unsuccessful) with these than an account you use daily. Also, accounts unused for a long time may become security risks.


Top
   
 Post subject:
PostPosted: Fri May 08, 2009 1:43 am 
Offline
Senior Member
User avatar

Joined: Mon Jul 21, 2008 1:26 pm
Posts: 171
Website: http://www.rejecttheherd.net
Location: Seattle
tronic wrote:
marcus0263 wrote:
Allowing remote root access is a really, really bad idea. Do yourself a favor and disable all remote root access, create a user with a really obscure name. Then just make sure they belong in the "wheel" group so you can just su over once logged in.

Then I would go even further and lock down ssh access by IP if at all possible. ;)


Ways to be safer:

1) sshd on an alternate port
2) disable password-based logins and allow only passphrase-based logins
3) use of sudo to gain root access instead of su might be better since it gives you more fine-grained control and also doesn't require you to be in wheel (wheel can be dangerous or a risk at times if ever compromised)
4) use of two-factor authentication. SecurID is common but really expensive. There's cheaper stuff for small scale setups, but can't remember what I looked at now.

I'm not fond of idea of having a separate login to use to become root because it's too easy to overlook any compromise attempts (successful or unsuccessful) with these than an account you use daily. Also, accounts unused for a long time may become security risks.

I don't see a problem with having "one" user with a complex/obscure login name and locking access to specific IP/IP's.

_________________
Image

Where "Thought Crime" is commited

http://www.rejecttheherd.net


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


Who is online

Users browsing this forum: No registered users and 4 guests


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