Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  Domain Name & DNS Issues  >  Learn To Add a User and Grant Root Privileges on Ubuntu 18.04
Top Scroll

Learn To Add a User and Grant Root Privileges on Ubuntu 18.04

 2 min

System admin can easily perform the task of adding a user and granting that user root privileges. Once the user gets added and assigned a root privilege then he will be able to login to your Ubuntu 18.04 and perform important functions that upkeep the system. Afterward, the user can use sudo before commands to perform elevated tasks.

This article will explain to you how to add a user and grant root permissions.

Point to Remember :These instructions are specially used for adding a user on Ubuntu 18.04 LTS.

Perform the following steps :

1. Add Username

In this example we will take a random username, Tom using the adduser command. You can replace Tom with your desired username. During this session, the system will also ask a user about my details. You can skip these details simply by pressing enter and eventually it will confirm that the information is correct, leading us to add a new user.
adduser

Output :

Output

2. Grant Root Privileges to the User

visudo

By entering the above command, we will be redirected to /etc/sudoers.tmp file, where we will be able to view the following code :

user specification

After the root user line, you will have to add a new user using the same format for us to grant admin privileges.

tom all
Once you have added the permission, save and exit the file using: wq and then enter.

3. Verify that User Has Privileges

If all the instructions are followed correctly, then you will be able to run some commands like update, suing the sudo

su tom

sudo apt

These are easy commands that you can perform.

For our Knowledge Base visitors only
Get 10% OFF on Hosting
New Year Savings
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.