Wiresharkを使用するためにLinuxユーザーにVisudoでアクセス許可を追加[閉じ

StackOverflow https://stackoverflow.com/questions/5809336

  •  24-10-2019
  •  | 
  •  

質問

「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!)

助言がありますか???前もって感謝します!

役に立ちましたか?

解決

Nopasswdの後にスペースを削除してみてください。また、すべてのコマンドを1行に配置することもできます。

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