How To Add A User on Ubuntu

If you are looking to create a new ordinary user account but immediately grant them administrator privileges on their account, please follow the following steps.

Open your terminal with:

Ctrl+Alt+T

Ordinary users are able to be granted administrator privileges should the root user grant them using the sudo command.

Log Into Your Server

Please log in to your server as the root user and enter the following commands one after the other:

Create The New User

# adduser username

where username is the name of the user you are adding.
You will be prompted to create a password for this user's account.
Enter new UNIX password:

Followed by:

Retype new UNIX password:

Then, if the passwords match you'll see the following out put

passwd: password updated successfully

You will then be asked to enter the new user's information. Leaving this blank is perfectly fine.

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]

Add the user to the sudo group with:

usermod -aG sudo username

You are able to test the user's access permissions by typing:

su - username

As the new user, test out your sudo privileges by listing the contents of the /root directory. You will be asked to enter the password you created before any commands run in your account.

sudo ls -la /root

If you are looking to configure the permissions for an existing user, use the following command:

usermod

Should you have any comments, please share them in the section provided below.