The sudo command allows normal users to gain administrator rights that are normally only available to the root user. This post will show you how to create a new user with sudo access on Ubuntu without having to change the sudoers file on your system.
Create new Sudo users
To add a new user to your machine, you need to use the root user to be able to add a new user
sudo su
adduser <username>
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/03/image-146.png)
Add the user to sudo group
Use the usermod command to add the user to the sudo group.
usermod -aG sudo <username>
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/03/image-147.png)
To test your new user, type this commands:
su <username>
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/03/image-148.png)
sudo apt update
![](https://www.nucleiotechnologies.com/wp-content/uploads/2022/03/image-150.png)
The command you gave with sudo should run with root privileges.
Reference
https://blog.tawfiq.me/how-to-create-a-non-admin-sudo-user-on-ubuntu/
https://www.cyberciti.biz/faq/how-to-create-a-sudo-user-on-ubuntu-linux-server/