How to get Superuser Privileges in Ubuntu

How do you run a command with the root privileges in Ubuntu Linux? To run a command as the root, you need to have superuser privileges.

To get root privileges you need to be a member of a sudo admin group. To check if you are a member of sudo group, Type:

groups | grep sudo

If you belong to sudo group, then you can run Linux commands with sudo keyword in front.

sudo apt-get update

When prompted to sudo password, type your own user password.

How to Give Superuser Privileges to a user in Ubuntu

To give superuser power to a user, add the user to the sudo admin group.

usermod -a -G sudo username

To remove a user from the sudo group, use the gpasswd command:

gpasswd -d username sudo