Add a User to the Sudoers group

If you have ever seen this message when issuing the Sudo command, it probably gave you some pause. What am I being reported for?

Username is not in the sudoers file. This incident will be reported.

In reality you probably just forget one important step and that was adding your user to the sudoers group. This can be cleared up easily in one quick command. Remember, this is a privileged command so be logged in as root!

Shell

Now that you have added your user to the sudoers group, it is time to test to make sure it works. The following code will execute whoami with the sudo command and the reply will tell you who the operating system thinks you are.

Shell

For various security concerns it is not good to run your Linux system as root all of the time, so sudo is your friend. As tempting as it is to stay logged in as root, get into the habit of elevating your privileges with sudo instead.

You may also like

Leave a Reply

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