小编Ben*_*och的帖子

“用户不在 sudoers 文件中”,但实际上是


我已经阅读了很多关于为特定用户启用 sudo 访问的帖子,但到目前为止这些都无济于事。
情况是:
我正在运行 Debian 测试。系统上只有两个帐户:“root”和用户帐户“benny”。用户“benny”应该能够使用 sudo 以 root 权限运行命令(当然我先安装了 sudo),这就是我使用 visudo 编辑“/etc/sudoers”文件的原因,如下所示:

Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL
benny   ALL=(ALL:ALL) ALL #<<<<<<<<<<<<<<< EDIT HERE!

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
ALL ALL= NOPASSWD: /usr/sbin/g15daemon
Run Code Online (Sandbox Code Playgroud)

这根本不起作用 - 发出“sudo”命令时,它一直说“benny 不在 sudoers 文件中”。将报告此事件。所以我将 benny …

linux debian sudo sudoers

7
推荐指数
1
解决办法
7744
查看次数

标签 统计

debian ×1

linux ×1

sudo ×1

sudoers ×1