Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SSHD and security
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
felixo
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2004
Posts: 88

PostPosted: Tue Feb 08, 2005 8:03 pm    Post subject: SSHD and security Reply with quote

Hello, I am getting many brute force attempts on my machine. This makes me semi nervous. I have followed most security measures mentioned here and on howto's.

I have but two questions:

1. How do I disable sshd logins attempts as root?. That is, how can I not allow root to login to the machine through sshd? Also, is this really something that can prevent a break in? if so, why?

2. How can I change which port sshd listens on?, and what port should that be?
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Tue Feb 08, 2005 8:08 pm    Post subject: Re: SSHD and security Reply with quote

See /etc/ssh/sshd_config. Pretty self-explanatory. 8)

P.S. I moved SSH to port 222 and have not seen a single break-in attempt since then, so yes - it reduces the noise quite drastically.
Back to top
View user's profile Send private message
justanothergentoofanatic
Guru
Guru


Joined: 29 Feb 2004
Posts: 337

PostPosted: Tue Feb 08, 2005 9:11 pm    Post subject: Reply with quote

Why worry about it? It's the equivalent of a port scan. You'll be fine as long as you avoid silly username/password combinations.

-Mike
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Tue Feb 08, 2005 9:40 pm    Post subject: Reply with quote

justanothergentoofanatic wrote:
Why worry about it? It's the equivalent of a port scan. You'll be fine as long as you avoid silly username/password combinations.

-Mike


First, you probably cannot be sure about the passwords.

Second, it´s extremely annoying. I have my logs parsed every few hours on my servers and alerts sent by email.

YMMV. :lol:
Back to top
View user's profile Send private message
nightblade
Guru
Guru


Joined: 20 Jul 2004
Posts: 368
Location: back from SE Asia

PostPosted: Tue Feb 08, 2005 11:18 pm    Post subject: Reply with quote

j-m wrote:

First, you probably cannot be sure about the passwords.

True. Even if passwords can be very secure, there is always room for improvement: certificates
_________________
In God we trust. All the others must provide a valid X.509 certificate
Back to top
View user's profile Send private message
felixo
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2004
Posts: 88

PostPosted: Wed Feb 09, 2005 12:51 am    Post subject: hmm Reply with quote

Certificates seems like overkill, and I am in charge of all the users on the machine, so passwords wont be a problem.

But I just hate the spam it generates in my logs :D

Thanks for your help guys.
Back to top
View user's profile Send private message
nightblade
Guru
Guru


Joined: 20 Jul 2004
Posts: 368
Location: back from SE Asia

PostPosted: Wed Feb 09, 2005 7:37 am    Post subject: Re: hmm Reply with quote

felixo wrote:

But I just hate the spam it generates in my logs :D

Then, as mentioned already, just change the port that ssh listens on. It will fool all the automated scripts, since they scan port 22 only.
_________________
In God we trust. All the others must provide a valid X.509 certificate
Back to top
View user's profile Send private message
CriminalMastermind
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 132
Location: toronto

PostPosted: Wed Feb 09, 2005 9:29 am    Post subject: Reply with quote

if the attempts are from the same ip's, and you know none of your users are ever going to log in from those ip's, then you could just block all traffic coming from those hosts using iptables.

just another option.
_________________
"I can picture a perfect world that knows of no war... and I can picture me attacking that world, because they'd never expect it."
Back to top
View user's profile Send private message
nightblade
Guru
Guru


Joined: 20 Jul 2004
Posts: 368
Location: back from SE Asia

PostPosted: Wed Feb 09, 2005 10:54 am    Post subject: Reply with quote

...or use portknocking...
yet another option...
_________________
In God we trust. All the others must provide a valid X.509 certificate
Back to top
View user's profile Send private message
VoVaN
l33t
l33t


Joined: 02 Jul 2003
Posts: 701
Location: The Netherlands

PostPosted: Wed Feb 09, 2005 12:12 pm    Post subject: Reply with quote

nightblade wrote:
...or use portknocking...
yet another option...

I think that's *very* secure option. That's cool :) Thank you for the advise.
Back to top
View user's profile Send private message
nightblade
Guru
Guru


Joined: 20 Jul 2004
Posts: 368
Location: back from SE Asia

PostPosted: Wed Feb 09, 2005 1:24 pm    Post subject: Reply with quote

VoVaN wrote:

I think that's *very* secure option. That's cool :) Thank you for the advise.

Actually, for a *very* secure setup, you should also force sshd to work with SSHv2 only, because v1 is vulnerable to MITM attacks.
_________________
In God we trust. All the others must provide a valid X.509 certificate
Back to top
View user's profile Send private message
felixo
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2004
Posts: 88

PostPosted: Wed Feb 09, 2005 5:26 pm    Post subject: Reply with quote

if I change the Protocol 2,1 to just Protocol 2 I assume it will disable login attempts with sshv1, but what applications will not work with it anymore?

I need rsync over ssh to work, and putty too.
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Wed Feb 09, 2005 5:33 pm    Post subject: Reply with quote

felixo wrote:
if I change the Protocol 2,1 to just Protocol 2 I assume it will disable login attempts with sshv1, but what applications will not work with it anymore?

I need rsync over ssh to work, and putty too.


I have no problems with SSHv2 - rsync and putty definitely works...
Back to top
View user's profile Send private message
felixo
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2004
Posts: 88

PostPosted: Sun Feb 13, 2005 3:17 pm    Post subject: Reply with quote

thanks guys, made the changes you guys said and the brute force attacks have gone down! :D

Also using protocol 2 only seems very ideal.

I still cannot find where to disable root logins over ssh, its not in the ssh_config or man ssh_config file (I should say, I cant find it :(
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Sun Feb 13, 2005 3:19 pm    Post subject: Reply with quote

felixo wrote:

I still cannot find where to disable root logins over ssh, its not in the ssh_config or man ssh_config file (I should say, I cant find it :(


You need sshd_config :wink:

Have a look at this post.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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