cd /etc
sudo gedit sudoers
# User privilege specification
root ALL=(ALL:ALL) NOPASSWD:ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD:ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
修改root admin sudo ALL=(ALL:ALL) ALL 为 ALL=(ALL:ALL) NOPASSWD:ALL