1

In the sudoers file, there is a line of code that says %sudo ALL=(ALL:ALL) ALL.

[...]
# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL
[...]

If I changed it to something like: bob ALL=(ALL:ALL) ALL, will bob be the only user who will be able to enter any command using sudo? And will all the other users that are in the sudo group not be able to input any command?

3
  • Why don't you try it?
    – NickD
    Oct 11, 2017 at 0:13
  • Thought it would be easier/better to ask, rather than do it and accidentally and somehow, like I always do, destroying something then having to fix it.
    – Hunter T.
    Oct 11, 2017 at 0:16
  • @Nick plus, I would do it on my Mac but it does not have the same sudo group and sudoers file. Mac and Linux in that respect, are not the same. The pic is from a private server that me and some people are trying to set up in a club, so I don’t want to accidentally screw anything up.
    – Hunter T.
    Oct 11, 2017 at 0:19

1 Answer 1

1

Assuming the usual caveats*, yes, bob will be the only sudoer if you replace that line with one you proposed.


* Caveats: No other sudoers rules of import. For example, some Linux distros also have rules for root (allowing everything), or for the group wheel (of a similar nature to the sudo group), etc. sudoers can also include other files and directories, so those files and directories should also be checked.

10
  • If there were still other users who belonged to the sudo group, would they still be able to use sudo, but not be able to use every command like you would otherwise?
    – Hunter T.
    Oct 11, 2017 at 3:06
  • @HunterT. Use sudo for?
    – muru
    Oct 11, 2017 at 3:07
  • Use sudo for example: nanoing into a file that you have to use sudo for: /etc/passwd
    – Hunter T.
    Oct 11, 2017 at 3:09
  • @HunterT. what's the difference between that and "not be able to use every command like you would otherwise"?
    – muru
    Oct 11, 2017 at 3:10
  • I’ll rephrase, say there are two people who belong to the sudo group: bob and jeff. In the sudoers file, if I change %sudo ALL=(ALL:ALL) ALL to bob ALL=(ALL:ALL) ALL, would sudo essentially become useless to jeff?
    – Hunter T.
    Oct 11, 2017 at 3:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .