无法使用/定位 sudo

ali*_*der 1 sudo

我正在使用 ubuntu 12 并且无法再使用sudo(几天前它正在工作)但显然以某种方式损坏了。以下是我尝试使用时收到的错误sudo

sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Run Code Online (Sandbox Code Playgroud)

除了重用 ubuntu live cd,还有什么我可以研究来解决这个问题的吗?

Eva*_*lva 6

您可以手动创建这样的sudoers文件:

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults        env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL
Run Code Online (Sandbox Code Playgroud)

您可以按照本指南了解如何编辑/创建sudoers文件。

另外,请检查此论坛主题