Add user to SUDO group

Posted by

For a long time it has been agreed that a standard user should run as one at all times except for when super user tasks need to be performed and running as the root user for extended periods of time is dangerous. With this in mind we have the application sudo.

sudo is an application that allows specified users limited root user privileges and log root user activity. The basic philosophy is to give as few privileges as possible but still allow people to get their work done.

In this tutorial, we will add a specific standard user to the sudo group.

Firstly, open the terminal and let us log in as the root user. Type in the command below and hit ENTER. This can be seen in screenshot below.

su -
Screenshot

You will now be prompted for the root user password. Type it into the terminal and hit ENTER. This can be seen in the screenshots below.

Screenshot
Screenshot

Now we are logged in as root user, we can now add our standard user to the sudo group. First we type adduser to indicate we are adding a new user. The second element is the standard username that we wish to add, in this case philwyett. The last element we add is the group we are adding the standard user to, in this case sudo. Type these into the terminal and hit ENTER. The complete command can be seen below as the command and a screenshot.

adduser philwyett sudo
Screenshot

In the screenshot below, you can see the output of the command you entered.

Screenshot

Now we have added our standard user to the sudo group, we need to exit from being logged in as the root user. Type in the command below and hit ENTER.

exit
Screenshot

In the below screenshot you can see we are no longer logged in as the root user and now back as our standard user.

Screenshot

To complete the task and be able to use the sudo command as the standard user we specified. We need to log out and back in or reboot your Personal Computer (PC).

Video on YouTube

Visit my YouTube channel and view the video related to this article: Add user to SUDO group.

Leave a Reply

Your email address will not be published. Required fields are marked *