Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Extra login attemps allowed...how to I stop?
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
krunk
Guru
Guru


Joined: 27 Jul 2003
Posts: 316

PostPosted: Sun Sep 05, 2004 4:14 pm    Post subject: Extra login attemps allowed...how to I stop? Reply with quote

I have set the max login retrys to 3 in my /etc/login.defs, however when someone attempts to login via ssh, they get 3 failures with no verbose output (as expected), but than they get an additional 3 attempts with a verbose prompt like this--->
Code:
krunk@<my_ip>'s password:


where are these other 3 coming from? Being that this reveals that there is, in fact, a user by that name at my ip I'd prefer to preveent this.
_________________
G4 1ghz iBook
PowerMac G3 (B&W) [Powered by Gentoo and Gentoo alone :)]

Dual G5
iPod 3rd generation
Back to top
View user's profile Send private message
krunk
Guru
Guru


Joined: 27 Jul 2003
Posts: 316

PostPosted: Sun Sep 05, 2004 6:29 pm    Post subject: Reply with quote

I solved it by using public keys w/ no password authentication.

First you add this to your /etc/ssh/sshd_config:
Code:

PasswordAuthentication no


Than if you use PAM with sshd (like I do, with the UsePAM yes option in sshd_config), you modify the /etc/pam.d/sshd llike so:

Code:

#%PAM-1.0
# modified to only accept publickeys
#auth       required  pam_stack.so service=system-auth
#auth       required     pam_shells.so
#auth    required pam_nologin.so
auth required /lib/security/pam_deny.so
auth required /lib/security/pam_warn.so
auth required /lib/security/pam_deny.so
account    required pam_stack.so service=system-auth
password   required pam_stack.so service=system-auth
session    required pam_stack.so service=system-auth


The above also enables logging for failed authentication attempts as well.

If you don't know how to do public keys with ssh, this is a good guide:
http://www.sshkeychain.org/mirrors/SSH-with-Keys-HOWTO/SSH-with-Keys-HOWTO-4.html
_________________
G4 1ghz iBook
PowerMac G3 (B&W) [Powered by Gentoo and Gentoo alone :)]

Dual G5
iPod 3rd generation
Back to top
View user's profile Send private message
TheGandalfMite
n00b
n00b


Joined: 09 Sep 2003
Posts: 21

PostPosted: Sun Sep 12, 2004 6:56 am    Post subject: Reply with quote

Hey all,

I'd just like to point out that the three extra password attempts do not, in fact, mean there's a valid account -- just ssh randomlongusername@host and you'll see what I mean 8)

TheGandalfMite
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