On Lu, 29 nov 21, 22:42:01, David Wright wrote:
>
> You don't have to use sudo in the manner shown above. You can use
> it to allow certain users to run certain commands. I use it to run
> a defined set of routine commands without having to bother to switch
> to root, or to authenticate, or be careful, or be sober.
Considering sudoers syntax is less than intuitive an example might be in
order:
# members of adm can run certain commands as root without supplying
# a password
Cmnd_Alias ADM_COMMANDS = /usr/bin/dmesg, \
/usr/bin/apt update, \
/usr/bin/apt upgrade, \
/usr/bin/apt autoremove --purge, \
/usr/sbin/reboot, \
/usr/sbin/poweroff
%adm ALL = (root) NOPASSWD: ADM_COMMANDS
(since /etc/sudoers is a conffile I prefer to have the above in a file
under /etc/sudoers.d/)
Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser
Attachment:
signature.asc
Description: PGP signature