Thursday, 17 August 2017

How to: Enable and Disable the User accounts in Linux/Unix



There are different methods of locking a user account in Linux. This article explains how to lock or disable a user account by locking their passwords in Linux.
Disable:

To disable a user account, just open the Terminal and run the below command:

[root@linuxcnf ~]# passwd -l username

Enable:

To enable an user account, just open the Terminal and run the below command:

[root@linuxcnf ~]# passwd -u username

To check the status of the User, You can check this command message running this command:

[root@linuxcnf ~]# passwd -S username
username LK 2017-01-29 0 99999 7 -1 (Password locked.)

In the output of the above command it will show "(Password locked.)".


That’s it, you achieve the target.

No comments:

Post a comment