Monday, February 16, 2015

Unlocking user account in AIX

When you have a locked user account but still have root access and the old password you can unlock it by entering the following two commands:
chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s username 
chuser "account_locked=false" username
The first command sets the unsuccessful login count back to zero and the second command unlocks the account. The user can use his account without resetting his/her account.
Obviously the second command by itself wouldn't unlock the account so you would have to enter both the commands.

If you do not have the old password then do this in root:
echo username:password | chpasswd -e
If you feel insecure about giving your password like this then you can give your password in encrypted for :
perl -e'print crypt("password","salt")'; echo -e
echo username:cryptedPass | chpasswd -e
Please feel free to share your comments below

No comments:

Post a Comment