{ 7 comments… read them below or add one }

1 Aaron C December 8, 2011 at 8:59 pm

From the top of /etc/pam.d/system-auth:

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.

Is there another place these options should be set so that authconfig does not clobber them? Right now, as a work around, I am going to `chattr +i /etc/pam.d/system-auth`.

Thanks,
Aaron

Reply

2 Yongzhi Pan January 8, 2012 at 5:39 am

Aaron C, Just edit this file and do not use authconfig.

It should be noted this will not effect for ssh remote login. You should put it in `sshd’ pam config file for this.

Reply

3 Yongzhi Pan January 8, 2012 at 6:23 am

“Append following AUTH configuration to /etc/pam.d/system-auth file”

This does not work. I have tested it. Even if the fails are recorded, login is not denied at all. The modules are tried in the order list. You have to prepend it before any ‘auth’ to use it.

Another note, we should be using the newer pam_tally2.so module.

Reply

4 tally June 7, 2012 at 5:41 am

pam_tally tool shows number of bad attempts by a user by using /var/log/faillog database. And after lockout time expires, with a correct login attempt count gets cleared. can someone tell me is there any way I can clear tally account automatically after the lockout time expires for a user.
I want to clear tally automatically once lockout time expires, don’t want to wait for user to login again with correct credentials.
Any help is highly appreciated.
Thanks

Reply

5 David March 5, 2013 at 9:54 am

Before doing this have a quick look in /lib64/security and check that there is a pam_tally.so file in there as you may need to use pam_tally2.so instead.
If in doubt add the line:
auth sufficient pam_tally.so onerr=fail deny=5 unlock_time=21600
to the system-auth file instead, then su or login in and check /var/log/secure for error messages.
You can change the sufficient to required if pam isn’t reporting errors.
That should save you getting locked out of the root account…

Reply

6 Ravinder July 6, 2013 at 8:16 am

Hi,
I tried the same but didn’t work for me. Can you tell me what shall i do. I am doing in centos 6.
Ravinder

Reply

7 Aaron C July 8, 2013 at 2:30 pm

Under CentOS 6 you should use pam_tally2.so.

You will want to modify both /etc/pam.d/system-auth-ac and /etc/pam.d/password-auth-ac.

In the auth section, under pam_env.so insert the following:

auth        required      pam_tally2.so deny=3 onerr=fail unlock_time=900

AND, in the account section, under pam_unix.so, insert the following:

account     required      pam_tally2.so

Make these edits in both files to cover remote and locally authenticated services. (Gnome, SSH)

Reply

Leave a Comment

Tagged as: , , , , , , , , , ,

Previous post:

Next post: