IM试图为名为“ Invitado”的用户设置权限,用于某些二进制文件: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!)

有什么建议么???提前致谢!

有帮助吗?

解决方案

尝试在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 可能是错的。那应该是2个命令, /usr/bin/aptitude/usr/bin/X11/wireshark.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top