Using passwd command to lock user account

If you have done RHCE Training or have some work experience on Linux. You know the significance of passwd command. But..

Did you know that you being a root can lock a system user from login into the machine using the passwd command.

Suppose you don’t want a user to login for any good reason, might be he/she is on leave or whatever.

Just lock his/her account for safety using the passwd command.

passwd -l username

Now, when he/she comes back, just unlock the account once again using the passwd command.

passwd -u username

Here is the screenshot from my machine, showing the usage of “passwd” command for locking/unlocking a user account.

PS: Join Network NUTS on Facebook, for regular updates about red hat exam dates and latest information.

using passwd command to lock a user

using passwd command to lock a user

Advertisements