
You may manually modify this file but I advise against it. The command basically works on the /etc/passwd file. You can also use this command to lock a user account. The passwd command in Linux deals with passwords of a user account. Method 1: Lock and unlock users with passwd command Please note that to do these changes, you need to either root or have root access via sudo. I’ll also discuss how to unlock the user. In this tutorial, I’ll show you three ways to lock a user in Linux command line. Perhaps an employee left the organization and instead of deleting the user altogether, lock the account for archival purpose. There could be a number of reasons why you would want to disable a user in your multi-user Linux environment. 3 ways to lock and unlock user accounts in Linux
