「root」がパスワードを指定せずにすべてのユーザーとしてコマンドを実行できるのはなぜですか?

「root」がパスワードを指定せずにすべてのユーザーとしてコマンドを実行できるのはなぜですか?

私の/etc/sudoers内容は次のとおりです。

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

上記の規則はありませんNOPASSWD。ユーザーがrootパスワードを入力せずにすべてのユーザーとしてコマンドを実行できるように見えるのはなぜですか?

ありがとうございます。

ベストアンサー1

rootユーザーはsudoに認証する必要がないため、パスワードを入力しなくても他のユーザーとしてコマンドを実行できます。

sudoersマンページから:

   User Authentication
     The sudoers security policy requires that most users authenticate themselves 
     before they can use sudo.  A password is not required if the invoking user is root, 
     if the target user is the same as the invoking user, or if the policy has disabled 
     authentication for the user or command. (...) 

関連:シェルユーザーがrootの場合、別のユーザー名でsuを実行すると、他のユーザーのパスワードを尋ねられますか?

おすすめ記事