当我尝试使用 sudo -I 命令时,出现此错误:
sudo: /etc/sudoers is owned by uid 33, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
所以我尝试使用pkexec chown -R root:root /etc/sudoers
但收到此错误:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized
This incident has been reported.
有人知道该怎么办吗?
编辑:
我想是因为我sudo chown www-data:www-data /
失误运行了,但是几秒之后我就停了下来。
您认为我该怎么做?
答案1
- 启动进入单用户模式获取 root 权限
- 跑步
chown root:root /usr/bin/sudo
- 重启