Operating System - HP-UX
1753877 Members
7575 Online
108809 Solutions
New Discussion юеВ

Unlocking an user account

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Unlocking an user account

Hi,

How to unlock an user account using command line ?

Thanks,
Shiv
6 REPLIES 6
Patrick Wallek
Honored Contributor
Solution

Re: Unlocking an user account

Use the modprpw command.

# /usr/lbin/modprpw -k username

If you want to see WHY the account is locked:

# /usr/lbin/getprpw -m lockout username

See the getprpw man page for an explanation of the data returned by the '-m lockout' option.
A. Clay Stephenson
Acclaimed Contributor

Re: Unlocking an user account

Patrick's answer is correct for a trusted system; for an untrusted system, locking via the passwd command is done by replacing the user's passwd hash with '*' although any non-null, non 13 characterslong string would work as well because that would be an impossible to match hash. By convention, the '*' character is used to lock the account; it is then unlocked by assigning a new password (or by entering a null value in the passwd hash field of that user's passwd file entry -- but that would be terribly insecure until a real password were entered).
If it ain't broke, I can fix that.
Arunvijai_4
Honored Contributor

Re: Unlocking an user account

Hi Shiv,

You can also do this by sam,

# sam -- Accounts for Users and Groups --> Users --> Select an user --> Actions

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Raj D.
Honored Contributor

Re: Unlocking an user account

Hi Shiv ,

If it is in a trusted env :

# /usr/lbin/modprpw -k username


or if it has deactivated , you can reactivate from SAM:


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
inventsekar_1
Respected Contributor

Re: Unlocking an user account

HI SHiv,
u got the solution.
little more information,

1. user can't lock his or her own account. root only can do that.
for example, users can't edit the passwd file. root only can edit that. but the user can change his or her passwd to a "*". in that case the account will be still there with the passwd a "*".

hope u got the difference.

2. users can be forced to change the passwd at next login. opposite also possible. ie,users can be forced for not changing the passwd. with the passwd aging, the root can able to do that.
Be Tomorrow, Today.
IBM INDIA
Visitor

Re: Unlocking an user account

Hi,
modprpw -l for checking user is locked or not.
if you found accout is lock then try this command
modprpw -k username