sudo:/ etc / sudoers在Ubuntu中是世界可写的

时间:2017-05-05 10:38:27

标签: ubuntu

我在 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中的文件。

0 个答案:

没有答案