LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 06-10-2003, 06:30 AM   #1
terminaljunkie
LQ Newbie
 
Registered: Feb 2003
Location: UK
Distribution: Red Hat V9
Posts: 17

Rep: Reputation: 0
pam_tally - Red Hat 9 - Does it work?


I have a RH9 system (also tried with RH7.3) with which I am trying to get a login lock working so that more than 3 tries creates a lock-out on any user that tries a brute force attack.

I read up and found pam_tally was probably the way to go, also that system-auth would be the best place to implement the required 'command' to perform the task.

My system-auth looked like this:

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required /lib/security/$ISA/pam_env.so
auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok
auth required /lib/security/$ISA/pam_deny.so

account required /lib/security/$ISA/pam_unix.so

password required /lib/security/$ISA/pam_cracklib.so retry=3 type=
password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password required /lib/security/$ISA/pam_deny.so

session required /lib/security/$ISA/pam_limits.so
session required /lib/security/$ISA/pam_unix.so

=============================================
I added a line following the last account statement - so it looks as follows:

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required /lib/security/$ISA/pam_env.so
auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok
auth required /lib/security/$ISA/pam_deny.so

account required /lib/security/$ISA/pam_unix.so

account required /lib/security/$ISA/pam_tally.so deny=3 no_magic_root reset

password required /lib/security/$ISA/pam_cracklib.so retry=3 type=
password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password required /lib/security/$ISA/pam_deny.so

session required /lib/security/$ISA/pam_limits.so
session required /lib/security/$ISA/pam_unix.so

============================================
No joy - the pam_tally module definitely exists, as does pam_tally (executable) - but it has no effect.

In the messages file I get this:

Jun 10 12:03:10 miloc0403 sshd(pam_unix)[1742]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=192.168.2.254 user=testuser
Jun 10 12:03:41 miloc0403 sshd(pam_unix)[1742]: 7 more authentication failures; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=192.168.2.254 user=testuser
Jun 10 12:03:41 miloc0403 sshd(pam_unix)[1742]: service(sshd) ignoring max retries; 8 > 3

It *looks* like something is intercepting the login before the pam_tally and rejecting, so my 'command' never actually get's hit - or is overridden?

Anyone *please* any tips on this - I feel like I'm about to kernel panic.

Thanks in Advance
 
Old 06-10-2003, 08:08 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,610
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
What does $ISA expand to? I haven't got it down like this, just a /lib/security/<pam_lib> path. Also, I'm using "tally" not in system-auth, but in login, as that's the service you need it for AFAIK. I also got onerr=succeed to not block any. If you want to get verbose PAM messaging to aid your troubeshooting efforts, almost all modules take the "debug" arg.

Btw, you try to login over ssh as *root*? Whatever your reason for it I would suggest not doing that but use a proper mechanism like sudo.
 
Old 06-10-2003, 08:21 AM   #3
terminaljunkie
LQ Newbie
 
Registered: Feb 2003
Location: UK
Distribution: Red Hat V9
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks for the reply.

$ISA is set by *authconfig* as far as I can tell - I just mirrored the syntax after trying it without (no difference).

[BTW I am trying to ssh in as testuser not root - ssh to root is not permitted on *any* systems I use ]

The reason I chose the system-auth is because I read (somewhere over the last 24 hours) that login calls system-auth, as do many of the other PAM modules - and if this works, it takes care of them as well!?!?!

My login module (see below) does call system-auth, but perhaps you are right and it is somehow in the wrong order (or some such). I will give login a try.

#%PAM-1.0
auth required pam_securetty.so
auth required pam_stack.so service=system-auth
auth required pam_nologin.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
session optional pam_console.so
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why does this not work on red hat 7? (ip masquerade etc) marco1974 Linux - Networking 1 02-08-2005 04:31 PM
Will Red Hat 9 Work?????? OMEGA-DOOM Linux - Software 2 05-18-2004 04:33 PM
Which scanners work best with Red Hat 9 ? Rick485 Linux - Hardware 2 01-27-2004 08:29 AM
Can't get my mouse to work in Red Hat activelylazy Linux - Newbie 2 10-04-2003 07:57 AM
Why won't my sound work I have red hat 7.2 please help wickywama Linux - Hardware 2 11-12-2002 06:24 AM


All times are GMT -5. The time now is 04:34 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration