我正在尝试为名为'invitado‘的用户设置权限,jus用于一些二进制文件: wireshark、tcpdump和traceroute。Iv根据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
ldac ALL=(ALL) NOPASSWD: ALL
# Allow members of group sudo to execute any command
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d
#Permiso de SUDO a guest de wireshark
invitado ALL=NOPASSWD : /usr/bin/aptitude/usr/bin/X11/wireshark
invitado ALL=NOPASSWD : /usr/bin/wireshark
invitado ALL=NOPASSWD : /usr/sbin/traceroute
invitado ALL=NOPASSWD : /usr/sbin/tcpdump但是,我总是得到相同的visudo错误输出:
>>> /etc/sudoers: syntax error near line 30 <<<
What now? Options are:
(e)dit sudoers file again
e(x)it without saving changes to sudoers file
(Q)uit and save changes to sudoers file (DANGER!)有什么建议吗?提前感谢!
发布于 2011-04-28 03:21:07
尝试删除NOPASSWD后的空格。此外,您可以将所有命令放在一行中。
invitado ALL = NOPASSWD: /usr/bin/aptitude, /usr/bin/X11/wireshark, /usr/bin/wireshark, /usr/sbin/traceroute, /usr/sbin/tcpdump编辑:还有,我认为/usr/bin/aptitude/usr/bin/X11/wireshark可能是错的。这应该是两个命令,/usr/bin/aptitude和/usr/bin/X11/wireshark。
https://stackoverflow.com/questions/5809336
复制相似问题