How to enable user to use "sudo"

How to enable user to use "sudo" when not configured

How to enable user to use "sudo"
sudo command

Sudo is a unix program that primarily enables users to run commands in elevated permissions. It initially stood for "supeuser do" however the linux community has changed that to "substitute user, do". Initially sudo could only give elevated permissions as root however the project has morphed and you can now run commands as other users as well.

Some Linux operating systems like ubuntu configure sudo automatically during setup however some Linux operating systems like Debian don't. In such a case you have to install and configure sudo yourself.

Installing "sudo"

Change the user to "root" by running su -

su -
su - command

Install sudo

apt install sudo
install sudo

Configuring "sudo"

In order for your user to use sudo you have to add your use to the sudo group.

 usermod -aG sudo username
add user to group sudo
💡
After the user is ready, Logout from the root user, then logout from your current user. When you log back in for sudo should work.

Test command

sudo echo "Hello World!"
test command
Enable sudo screenshot

Subscribe to Bluedoa Digest

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
alexander@example.com
Subscribe