I added a user to sudo , but I don't see that user in /etc/sudoers

Linode Staff

I set up my server on Ubuntu 16.04 LTS, and after creating a user and adding sudo privileges to that user, I checked the following file to see user permissions:

$ cat /etc/sudoers

The user that I created is not listed in the sudoers file. How can I check what groups that my user is in?

1 Reply

Adding a user to sudo doesn't directly add the user in the file /etc/sudoers. Usually if you check the end of the sudoers file, you will see the output dividing users and groups. Adding the user to sudo will just add the user to the sudo group, not add the users name to /etc/sudoers. You can verify what groups a user is in by running the following command:

$ groups myuser

This will output the groups that myuser is in. If you see sudo listed as a group, the user is able to run sudo.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct