How to Deactivate a User Account on Ubuntu

You can deactivate a user account on Ubuntu by using command-line. There’s a GUI-way of doing this, of course; but command-line approach of doing this very straightforward and easy.
The following command will deactivate a user’s password thus disallowing him to log in. Open terminal and execute the following command replacing username with that user’s username:

sudo passwd -l username

Now to re-enable that user’s account, simply execute the following command replacing username with that user’s username:

sudo password -u username

Remember that, all files and folders belonging to that user will remain intact even though you deactivate his/her account. Those files/folders would be available upon re-enabling the user account.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s