Saturday, October 15, 2016

Disable User Login (Lock Password) on Linux

To lock a user account on linux, you can use the passwd command.

The command is,

sudo passwd -l username

For example, to lock the user 'linda', so 'linda' can not login to the system anymore,

sudo passwd -l linda
Locking password for user linda.
passwd: Success

Now you can try to login as 'linda' and you will see that you login is disabled.

No comments:

Post a Comment