How To Disable a Linux Account?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Use the usermod command to disable the account:
usermod -L username
2. Use the passwd command to set an empty password for the account. This will prevent the user from logging in through a password:
passwd -d username
3. Use the chage command to disable the account by setting an expiration date in the past:
chage -E 0 username
4. Use the usermod command to lock the account:
usermod -L username
You can disable a Linux account by using the following command: `sudo usermod –L <username>` This will lock the specified user from logging in. To re–enable the account, you can use the command: `sudo usermod –U <username>`