How Do I Disable a Linux Account?
Contents You Need to Use the Usermod Command to Lock and Disable User Account. the -L Option Lock User’s Password by Putting a! in from of the the Encrypted...
You need to use the usermod command to lock and disable user account. The -L option lock user’s password by putting a ! in from of the the encrypted password. To disable user account set expire date to one or 1970-01-01.
How do I unlock a Linux account?
How to unlock users in Linux? Option 1: Use the command “passwd -u username”. Unlocking password for user username. Option 2: Use the command “usermod -U username”.
Must Read
Can you disable the root account in Linux?
The simplest method to disable root user login is to change its shell from /bin/bash or /bin/bash (or any other shell that permits user login) to /sbin/nologin , in the /etc/passwd file, which you can open for editing using any of your favorite command line editors as shown. Save the file and close it.