How to Add a User and Grant Root Privileges on Ubuntu 14.04

Step 1: Add the User

It’s just one simple command to add a user. In this case, we’re adding a user called mynewuser :

adduser mynewuser

First you will be prompted to enter the user’s password (twice); do this step. Next you’ll be prompted to enter in the user’s information. This step is not required, and pressing enter fills the field with the default information:

Adding user `mynewuser’ …
Adding new group `mynewuser’ (1001) …
Adding new user `mynewuser’ (1001) with group `mynewuser’ …
Creating home directory `/home/mynewuser’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for mynewuser
Enter the new value, or press ENTER for the default
Full Name []: User
Room Number []:
Work Phone []:
Home Phone []:
Other []:

When prompted with the following question, enter Y then hit enter to continue.

Is the information correct? [Y/n] Y

Step 2: Grant Root Privileges to the User

visudo

Find the following code:

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

In this case, we’re granting root privileges to the user mynewuser . Add the following below that code:

mynewuser ALL=(ALL:ALL) ALL

Then exit and save the file with the key commands Ctrl-x, Y, enter.

If you’ve followed the instruction above correctly, then you should now have a user setup by the name of mynewuser which can use sudo to run commands as root!

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How To Install Docker on CentOS 7

Step 1: Installation of Docker As a matter of best practice we’ll update our packages:...

How to Check Your CentOS Version

The following command works with all CentOS versions. cat /etc/centos-release You should...

Using SSH Keys

This tutorial describes the process of setting up SSH Keys for use when logging in to a remote...

How To Install Git on Ubuntu 14.04

Introduction Git is an open source, distributed version control system (VCS). It’s...

How to Install VNC Server on Ubuntu 14.04 LTS

VNC is short for ‘Virtual Network Computing’. It’s a simple method for sharing a graphical...

Powered by WHMCompleteSolution