If you’re using a Linux Mint system, you’ll probably need to add or remove a user at some time. User accounts work essentially the same way in Linux Mint as they do in Windows: they allow you to log in to your account securely, install programs and updates, protect against hackers and other prying eyes. There are two basic ways to add and remove users in Linux Mint: at the command line and in the GUI.

Adding an account is fairly simple and straight-forward, however, removing an account can be a little trickier. The best practice is to back up user files before removing any user account.

Add and Remove Users at the Command Line

When adding a new user, first you have to choose a unique username. If the username you choose is too similar to existing usernames, Linux might not set up the account properly.

The next step is to choose a strong password, which should ideally contain a combination of letters, numbers, and special characters. Here, we create a new account on Linux Mint with the username John.

Linux will create a home directory for the new user, then walk you through the steps to enter the password, full name, room number, phone numbers, and ask you if the information is correct.

When for any reason you feel the need to remove this user, you first need to make sure they are logged out. To find out who is logged into your Linux Mint system, type this at the command line:

who

Here, both the home account and the John account are logged in. If you’re logged into another account, you can log John off by typing:

sudo pkill -KILL -u john

Now, John is logged out. You can create a backup of his user folders by typing:

sudo tar -zcvpf johnfolderbackup.tar.gz /home/john

Type the following in the folder where you created the backup to ensure that it was created properly:

ls -lh johnfolderbackup.tar.gz

Close the terminal window and open a new one. Now you can remove the unwanted user account.

sudo deluser john

The user account removal completed with no errors.

If you used different names for your accounts and/or filenames, simply replace the examples above with the names you used on your Linux installation.

Add or Remove Users in the GUI Menus

In the Linux Mint window, click Menu – All – Users and Groups. Click the Add button and enter your password.

Under Create a new user, type the username for the account you wish to create.

Now create a strong password.

Before removing a user account, be sure to back up their files first. Log into the account that you have chosen for deletion. Click Menu – All – Backup Tool. Under Personal Data, select Back Up Now.

Choose a location for your backup. Click Forward.

Select whether you’d like to exclude any files or directories. Click Exclude Directories, then click Forward.

Select the folders you’d like to exclude from the backup, then click Open.

Next, click Include Directories.

Select a folder you would like to back up. Click Open. Repeat until you have added all the folders you wish to back up.

If you prefer to select files to back up rather than directories, simply select Exclude Files and Include Files and select the files you want. However, working with directories will probably be the easiest and most effective method in most cases.

Click Apply. Linux Mint will now save your backup as a .tar file in your chosen backup folder.

Now, log out of the account, and log in to another administrator account. Then simply select the account you wish to delete and click Delete in the Users Settings dialog in Users and Groups.

Select whether you’d like to Keep Files or Delete Files. If you are not ready to remove the account, click Don’t Remove Account.

For help and support with adding and removing user accounts, visit the Linux Mint Forums.

Additional Reading

One thought on “How to Add and Remove Users in Linux Mint

Leave a comment