l'aggiunta di permessi con visudo a un utente Linux per l'utilizzo di Wireshark [chiusa]
Domanda
Nel tentativo di impostare le autorizzazioni per un utente denominato 'invitado', jus per alcuni binari: wireshark, tcpdump e traceroute. Iv fatto secondo la sintassi sudoers che credo sia il seguente:
# /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
Tuttavia, continuo ottenendo lo stesso risultato errore 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!)
Qualche suggerimento ??? grazie in anticipo!
Soluzione
Prova a rimuovere gli spazi dopo NOPASSWD. Inoltre, è possibile mettere tutti i comandi su una riga.
invitado ALL = NOPASSWD: /usr/bin/aptitude, /usr/bin/X11/wireshark, /usr/bin/wireshark, /usr/sbin/traceroute, /usr/sbin/tcpdump
Modifica
Inoltre, penso che /usr/bin/aptitude/usr/bin/X11/wireshark
era probabilmente sbagliato. Questo dovrebbe essere 2 comandi, /usr/bin/aptitude
e /usr/bin/X11/wireshark
.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow