在启动时进入安全模式,这时是用root登录的,执行:
chmod 740 /etc/sudoers
然后打开/etc/sudoers这个文件,把最后一行:
# User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL
改为
# User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) NOPASSWD:ALL
保存退出。
执行:
chmod 0440 /etc/sudoers
完成
标签:etc,sudoers,sudo,chmod,密码,members,Ubuntu,root From: https://www.cnblogs.com/cx850116/p/17379331.html