How to create a new user and provide the root or sudo privileges

Introduction:

In this blog we would learn about how to create a new user and add the same user to the root group or with sudo privileges. The sudo command provides a mechanism for granting administrator privileges and how to modify sudoers group in different ways & how to login with new user in the different ways.

Step 1: Open the terminal and login with the root user.

 

1

 

Step 2: Now add a new user to the system with new username with below command.

adduser new

 

2

 

Step 3: Now provide following information to create a new user.

 

3

 

Step 4: Now new user is created. To verify that your user is created or not. Check it to the home directory.

 

cd /home

ls

 

5

 

Step 5: Now add user to the sudo group.

usermod -aG sudo new1

 

6

 

In second method go to /etc/group and add the sudo group to your new user name.

 

7

 

Step 6: Now, how to change the user to root to new user.

su new1

Then, provide password of the new user.

 

8

 

New user is now created with sudo privileges.

Leave a Reply