Score:0

Deleting files under /etc/sudoer.d

kz flag

I granted another user account sudo privileges for running Docker commands by adding a file with their username directly under /etc/sudoers.d:

username ALL=(root) NOPASSWD:/usr/bin/docker

I now want to revoke these privileges, I assume it is perfectly safe to just delete the file? So just:

sudo rm /etc/sudoers.d/username

I have assumed many things in the past that have turned out to be incorrect... The file was originally created using visudo and has -r--r----- privileges (owner and group = root).

18.04 LTS.

Score:1
ru flag

Yes, if the only definition was that single user's access to a specific docker command set, then it is safe to remove the file.

In case you are afraid to do this, just go into the file, and put a # at the beginning of every line, which will disable whatever the permissions are specified in there. That will have the same effective action (there's things that ZFS, etc. install in here sometimes and have similar setups).

If there are other definitions under there or in /etc/sudoers then you need to make sure those are still correct in syntax or sudo will break. However, just removing the file will remove that permission set from the sudo privs.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.