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

Cpanel/Whm License $3/mo Plesk License $10/mo Cloudlinux License $5/mo

Users via Command Line 101: Basic User Interaction
I. How to Add a User and Grant Root Privileges on Ubuntu 12.04 LTS
II. How to Remove (Delete) a User on Ubuntu 12.04 LTS
Pre-Flight Check
  • These instructions are intended specifically for adding a user on Ubuntu 12.04 LTS.
  • I’ll be working from a sxi.io Web Core Managed Ubuntu 12.04 LTS server, and I’ll be logged in as root.

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!

Related posts

The Strangest Altcoins of 2014

SXI ADMIN

Bitmain Reportedly Eyeing Canada for Bitcoin Mining Expansion

SXI ADMIN

5 Things Bitcoin Owners Must Do When Estate Planning

SXI ADMIN

Heartbeat-Sensing Wristband Doubles as Bitcoin Wallet

SXI ADMIN

How to find disk I/O latency with ioping monitoring tool on Linux

SXI ADMIN

What does a plus + at the beginning of a line in the /etc/passwd UNIX / Linux password file signify?

SXI ADMIN

Hyperledger Adds to Blockchain Group in Time for Sibos

SXI ADMIN

Bitstamp to Resume Bitcoin Withdrawals Today

SXI ADMIN

How To Setup Email on Android

SXI ADMIN

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More