Category Archives: Operating Systems

Operating Systems general commands and issue fixes cover in Linux , Windows, Solaris, Unix , HP-UX etc.

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
password:
#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

Example:
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