Operating System - HP-UX
1837509 Members
3738 Online
110117 Solutions
New Discussion

Re: identifying locked users, locking & unlocking users

 
Ravinder Singh Gill
Regular Advisor

identifying locked users, locking & unlocking users

Hi,

How do I check if a particular user's account has been locked?

Also how do I lock and unlock accounts?
4 REPLIES 4
Ivan Krastev
Honored Contributor

Re: identifying locked users, locking & unlocking users

See KB doc id USECKBRC00008606 :
How to report inactive (locked) user accounts on a trusted system

There is also a script attached to perform task.

regards,
ivan
A. Clay Stephenson
Acclaimed Contributor

Re: identifying locked users, locking & unlocking users

I assume for the moment that this is a trusted system. You should have made that distinction.

Plan A.
logins | awk '{print $1}' | while read U
do
/usr/lbin/getprpw -m lockout ${U}
done

Locked users will have a '1' in at least one location in the lockout string.

Plan B.
logins -x

Locled accounts will display "LK".

To unlock a trusted account, /usr/lbin/modprpw -k user.

To unlock a standard system, replace the bogus password hash (typically '*') with a valid passwd hash. (i.e. run the passwd command).

Man logins, getprpw, modprpw for details.
If it ain't broke, I can fix that.
Robert-Jan Goossens
Honored Contributor

Re: identifying locked users, locking & unlocking users

Hi,

/usr/lbin/modprpw -e useraccount

To lock an account.

/usr/lbin/modprpw -k useraccount

to unlock.

Link to above doc.
Europe
http://www8.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01031510-2
US
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01031510-2

Regards,
Robert-Jan
Uday_S_Ankolekar
Honored Contributor

Re: identifying locked users, locking & unlocking users

If your server is not trusted then best bet would be logins command.

modprpw and getprpw is available only for trusted server.

logins -x would report details of all users, and you should be looking for "LK"

-USA..
Good Luck..