小编Des*_*ves的帖子

用于命令的 Sudoers NOPASSWD 不起作用,但 ALL 是

我一直试图在没有密码的情况下授予www-data使用sudo service apache2 restart权限,但无论我尝试什么,都无济于事。我在不同的论坛上阅读了数百篇关于这个问题的帖子,但没有任何帮助。

我知道权限是按顺序添加的,所以特定的命令应该放在列表的末尾。这是我的文件:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
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

# Members of …
Run Code Online (Sandbox Code Playgroud)

permissions command-line sudo password apache2

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

apache2 ×1

command-line ×1

password ×1

permissions ×1

sudo ×1