0%

修改/etc/sudoers文件出错导致问题解决方案

出错实例

>>> /etc/sudoers: syntax error near line 21 <<<
sudo: parse error in /etc/sudoers near line 21
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

之后尝试使用

  • pkexec visudo又报错
    ==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
    Authentication is needed to run `/usr/sbin/visudo' 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

    解决方案

  • 参考链接