Linux Redhat account claims locked even after unlocking

0

The local linux account won't allow the user to login even after unlocking it.

The following command provides the following output:

[userBar@host]$ sudo usermod -U userFoo

[sudo] password for userBar:

[userBar@host]$

and the following command provides the following output:

[userBar@host]$ sudo passwd -u userFoo

[sudo] password for userBar:

Unlocking password for user userFoo.

passwd: Success

[userBar@host]$

And I changed the password to a known value. But when the user attempts to log in (I'm su-ing in, but the same message is seen in a straight ssh):

[userBar@host]$ su userFoo

Account locked due to 34 failed logins

Password:

su: incorrect password

And yet running passwd -S gt2adm doesn't show the account as locked, nor does /etc/shadow show any error.

This started happening after some mounts were added by another admin and it wasn't happening before for this specific user.

Googling around I can't find another way to unlock the account, and it seems like a locked account should show up in either the passwd or shadow file, yet it's not. I've unlocked the account multiple times (with both commands) and have even rebooted the machine once.

Ranger

Posted 2015-07-01T23:40:14.037

Reputation: 623

What about unlocking the account then assigning a new password to the affected account. – mdpc – 2015-07-01T23:50:58.003

I did change the password after unlocking. "And I changed the password to a known value." Still have the issue, and the login is still seeing it as locked even though nowhere else sees the locked status. – Ranger – 2015-07-01T23:53:21.017

Try restarting nscd too..... – mdpc – 2015-07-01T23:54:50.373

Also are there duplicate username records? – mdpc – 2015-07-01T23:57:16.900

Server doesn't have /usr/sbin/nscd to restart, assuming I'm looking at/thinking of what you're speaking about. And /etc/shadow and /etc/passwd only have one entry each for this user, but that was a good idea and something I hadn't thought of. – Ranger – 2015-07-01T23:59:24.020

Answers

1

You can execute the below command as root to unlock the account.

pam_tally2 --user=<user name> --reset

venkat

Posted 2015-07-01T23:40:14.037

Reputation: 11