How to add Sudo Users in Ubuntu 20.04

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>

Add the user to sudo group

Use the usermod command to add the user to the sudo group.

usermod -aG sudo <username>

To test your new user, type this commands:

su <username>

sudo apt update

The command you gave with sudo should run with root privileges.


Leave a Comment

Your email address will not be published. Required fields are marked *