How to create a user and give sudo privileges on Ubuntu

Creating user

First you need to login as root: su

adduser desired_username

If you don’t want to be logged in as root, you need to write sudo before executing that command: sudo adduser desired_username

Assigning sudo privileges

First you need to login as root: su

usermod -aG sudo desired_username

Now, our user desired_username can use sudo command.

Share This:

Get The Best Of All Posts Delivered To Your Inbox

Subscribe to our newsletter and stay updated.