- Nikhil Bhaskar
- May 2, 2021
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.
Step 2: Now add a new user to the system with new username with below command.
Step 3: Now provide following information to create a new user.
Step 4: Now new user is created. To verify that your user is created or not. Check it to the home directory.
Step 5: Now add user to the sudo group.
usermod -aG sudo new1
In second method go to /etc/group and add the sudo group to your new user name.
Step 6: Now, how to change the user to root to new user.
Then, provide password of the new user.
New user is now created with sudo privileges.