Add user to Sudo in Ubuntu Operating System

Give the user the sudo privileges in Ubuntu

Create a new user with a root user with Sudo privileges

Open the terminal window and add a new user with the following command:

#su root
#adduser oracle

Add the new user to the Sudo group. In my case username is oracle:

#usermod -aG sudo oracle

Verify the user has sudo group

#groups oracle

root@Oracle1:/home/sunny/Desktop#groups oracle
oracle : oinstall sudo dba

Verity with ls command to check home of other user:

oracle@Oracle1:/home/sunny/Desktop$ ls /home/sunny

ls: cannot open directory '/home/sunny': Permission denied

oracle@Oracle1:/home/sunny/Desktop$ sudo ls /home/sunny

Desktop        Documents  Music     Public  Templates

docker-images  Downloads  Pictures  snap    Videos


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.