My /etc/sudoers
has content:
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
There is no rule above specifying NOPASSWD
. I was wondering why user root
seem to be able to execute any command as any user without providing password?
Thanks.
User Authentication
section of the manual (https://www.sudo.ws/man/1.8.17/sudoers.man.html).Since root is already root and can already run any command as root,
sudo
just passes through the command to the shell. – Tim Kennedy May 24 '18 at 04:12