How to Create and Delete User on Ubuntu 16.04

We will show you how to create and delete a user on Ubuntu 16.04. By default, when your server is created for the first time, only a root user account is created. This root account has access to all the files and commands on the system. But having too many privileges and running as root user is not always recommended and if you are not careful enough can be destructive for your system. That’s why it is recommended to create additional users with limited privileges for your most common tasks. A new user account should also be created for any other user that will be using your server. Additionally, you can also give those users root privileges when necessary through the sudo command.

Create a new User on Ubuntu 16.04

Once logged, you can create a new user with the adduser command. To add a user called “tom”, you can type the following in your command line:

adduser tom

You will be asked some additional questions.
First, you will need to enter and confirm a password for this user.
Then you will be asked for some additional information about the user, such as full name, room number, work phone, home phone and other. This information is optional and you can just press ENTER on each question to skip it.
At the end, you will be asked for confirmation about all the information you have entered so far. If everything is correct just press Y and then Enter.

This is the output that you should get, for our new user called tom:

Adding user `tom' ...
Adding new group `tom' (1000) ...
Adding new user `tom' (1000) with group `tom' ...
Creating home directory `/home/tom' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for tom
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y

With this, your new user called “tom” has now been successfully created. Its home directory has also been created at the following location on your server: /home/tom

Delete a User on Ubuntu 16.04

Once we no longer need a specific user, we can delete it with the deluser command.

Let’s say we want to delete the user “tom”. You can run the following command to do this:

deluser tom

However, this will not delete the user’s home directory. If you want to delete the user’s home directory as well, you should run the following command:

deluser --remove-home tom

The user is now completely removed from our system.

This is all you need to know when it comes to creating and deleting a user on Ubuntu 16.04.

Of course, you don’t have to create and delete users on Ubuntu 16.04 , if you use one of our managed VPS Hosting services, in which case you can simply ask our expert Linux admins to help you create a new or delete an existing user on Ubuntu 16.04. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to create and delete a user on Ubuntu 16.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thank you.