我以为这是一个非常简单的过程。我想基本上重新加载 Apache(因为我会经常添加/删除虚拟主机),但我似乎无法让 Apache 重新加载而不提示我输入密码。
这是我的/etc/sudoers
文件:
#
# 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 mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
subzero ALL=(ALL) NOPASSWD:/etc/init.d/apache2 reload
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# 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
我已经注销并重新登录,但仍然无法使用。知道为什么无法使用吗?
我还试图将它移到底部,以防它是优先事项,但仍然没有运气。
答案1
您确实在打字吗sudo /etc/init.d/apache2 reload
?您必须打字。
您是否已检查过/var/log/auth.log*
?/var/log/syslog*
–