sudo:/etc/sudoers在Ubuntu中是可写的
我在ubuntu用户中使用了sudo:/etc/sudoers在Ubuntu中是可写的,ubuntu,Ubuntu,我在ubuntu用户中使用了chmoda+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使用sudo了` ubuntu@VM-250-150-ubuntu:~$ sudo sudo: /etc/sudoers is world writable sudo: no valid sudoers s
chmoda+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使用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
我没有任何根密码,所以我尝试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.
朋友们,你能帮我不重新安装吗?我非常后悔
我希望我的故事能帮助别人。不要随意更改
/etc的权限。最好使用sudo visudo
或在/etc/sudoers.d
中编辑一个文件。这个问题似乎与中定义的堆栈溢出无关。它可能更适合于堆栈交换站点。或站点。