sudo chmod u+w /etc/sudoers
sudo vi /etc/sudoers
找到:
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
修改为:
# root and users in group wheel can run anything on any machine as any user
#root ALL = (ALL) ALL
#%admin ALL = (ALL) ALL
root ALL = (ALL) NOPASSWD: NOPASSWD: ALL
%admin ALL = (ALL) NOPASSWD: NOPASSWD: ALL