What do the "ALL"s in the line " %admin ALL=(ALL) ALL " in Ubuntu's /etc/sudoers file stand for?
Solution 1:
There is a manual page for sudoers(5).
Basically:
-
%admin
– the group named "admin
" (%
prefix) -
ALL=
– on all hosts (if you distribute the samesudoers
file to many computers) -
(ALL)
– as any target user -
ALL
– can run any command
A more restricted example would be:
%mailadmin snow,rain=(root) /usr/sbin/postfix, /usr/sbin/postsuper, /usr/bin/doveadm
nobody ALL=(root) NOPASSWD: /usr/sbin/rndc reload
In this case, the group mailadmin
is allowed to run mail server control tools as user root
on hosts named "snow
" and "rain
". The user nobody
is allowed to run rndc reload
as root, on all hosts, without being asked for any password. (Normally sudo asks for the invoker's own password.)