我在 ubuntu 用户中使用了chmod a+x /etc/sudoers
这让我后悔...
ubuntu@VM-250-150-ubuntu:~$ ll /etc/sudoers
-rw-rw--w- 1 root root 781 May 5 11:12 /etc/sudoers
然后我可以t use
sudo`
ubuntu@VM-250-150-ubuntu:~$ sudo
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
我没有 root密码,所以我尝试pkexec chmod 440 /etc/sudoers.d
来修复它。
但它有另一个问题,我输入 ubuntu的密码:
ubuntu@VM-250-150-ubuntu:~$ pkexec chmod 440 /etc/sudoers.d
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/chmod' as the super user
Authenticating as: ubuntu,,, (ubuntu)
Password:
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.
朋友们,你能不帮我重新安装吗?我很后悔....
我希望我的故事可以帮助别人。让t change the privilege of
/ etc optionally. It
更好地使用sudo visudo
或编辑/etc/sudoers.d
中的文件。