Want to quickly disable or lock a user account in Ubuntu? With all modern operating systems, a locked or disabled account will not be allowed to login until the restrictions is removed. Ubuntu is no different. Disabling an account is the easiest way to stop a user from logging in without completely removing or deleting his/her account.
This brief tutorial will show you how to do it in Ubuntu.
Objectives:
- Disable an account in Ubuntu
- Enjoy!
To get started, press Ctrl – Alt – T on your keyboard to open Terminal. When it opens, run the commands below to lock an account.
sudo passwd -l <username>
Replace <username> with the account name
When the user tries to login, he/she will get invalid password error.
That’s it.
To unlock the the user account, run the commands below:
sudo passwd -u <username>
Enjoy!
Loading


