How to add a user on Ubuntu 18.04

In this example I will add a user that is called “genie”, using the adduser command. Replace genie with your desired username. When you add your username the system will also ask for more details. Feel free to skip those details by pressing enter and eventually it asks us to confirm that the info is correct.

Step 1: Create username
adduser genie

output:

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

And this is all you have to do.

If you want to add root privileges to this user you need to make a few more steps.

Step 2: Grant Root Privileges to this user
visudo

This command leads us to the /etc/sudoers.tmp file, where we find the following lines:

# User privilege specification
root    ALL=(ALL:ALL) ALL

After the root line you will need to add the following line:

genie ALL=(ALL:ALL)ALL

Once you added the permissions, you need to save and exit the file. You can do this with “ctrl” + “x” and at the prompt, press “y” and then hit “enter” to save and exit the file.

If no update was made, you can run:

sudo apt-get update

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top