Friday, December 14, 2012

Linux Locking An Account

how do I lock an account (user login id) under Linux operating system?

You can use the passwd command to change user or group accounts password. A normal user may only change the password for his/her own account, the super user (root) may change the password for any account. You can use the passwd command for locking or unlocking an account.

Task: Linux Locking an Account

The syntax is as follows:
 
passwd -l {username}
 
The -l option disables an account by changing the password to a value which matches no possible encrypted value. In this example, lock user account named vivek. First, login as a root user and type the following command:
# passwd -l vivek

Task: Linux Unlocking an Account

The syntax is as follows:
 
passwd -u {username}
 
The -u option re-enables an account by changing the password back to its previous value i.e. to value before using -l option. To unlock user account named vivek. Login as a root user and type following command:
# passwd -u vivek

See also:



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

No comments:

Post a Comment