chmod 777 /etc/sudoers
vim /etc/sudoers
修改加入内容:
# User privilege specification
root ALL=(ALL:ALL) ALL
www-data ALL=(root) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
%www-data ALL=(ALL:ALL) NOPASSWD:ALL
# See sudoers(5) for more information on "#include" directives:
运行:
root@raspi-control:~# sudo whoami
sudo: /etc/sudoers 可被任何人写
sudo: 没有找到有效的 sudoers 资源,退出
sudo: 无法初始化策略插件
处理:
pkexec chmod 0440 /etc/sudoers