Monday, March 31, 2014

Using passwd command to lock and unlock Linux Account

To lock a linux account, you can use the command

# passwd -l username
Locking password for user username.
passwd: Success

You will notice on the /etc/shadow file, that there will be a ! before the encrypted password string
user1:!...........................

To unlock the linux account, you can use the command
# passwd -u username
Unlocking password for user username.
passwd: Success.

No comments: