Can you please direct me to some examples and more detailed instruction on /etc/sudoers.d/
I'd like to give some group permission to sudo some commands, but in a proper way not to create unnecessary loopholes in the Ubuntu security model on a multi-user machine.
In ancient times I did some simple sudoers customisations, but apparently now /etc/sudoers.d/ is a more proper way and I'd like to better understand it.
As this question says,
/etc/sudoers
is a system-wide configuration file that can be automatically changed by system upgrades and is highly fragile to improper changes. You can potentially lose access or make your system unbootable with an improper change.Contrary to what you might expect, the
#includedir
directive is not a comment. It has the effect of causingsudo
to also read and parse any files in the/etc/sudoers.d
directory (that do not end in '~' or contain a '.' character).Unlike
/etc/sudoers
, the contents of/etc/sudoers.d
survive system upgrades, so it's preferrable to create a file there than to modify/etc/sudoers
.You might want to edit files in this directory with the
visudo
command:Please note that
visudo
may use a different editor instead ofnano
as described at https://help.ubuntu.com/community/SudoersHere are a few more links that I found helpful: