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?

  • Why don't you try it? – NickD Oct 11 '17 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. – StrangeRanger Oct 11 '17 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. – StrangeRanger Oct 11 '17 at 0:19
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.

  • 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? – StrangeRanger Oct 11 '17 at 3:06
  • @HunterT. Use sudo for? – muru Oct 11 '17 at 3:07
  • Use sudo for example: nanoing into a file that you have to use sudo for: /etc/passwd – StrangeRanger Oct 11 '17 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 '17 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? – StrangeRanger Oct 11 '17 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.