l'ajout d'autorisations avec visudo à un utilisateur de Linux pour utiliser wireshark [fermé]
Question
Im essayant de définir des autorisations pour un utilisateur nommé 'invitado', jus pour certains binaires: Wireshark, tcpdump et traceroute. Iv effectuée conformément à la syntaxe de sudoers qui je pense est la suivante:
# /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
Cependant, je continue à obtenir la même sortie d'erreur de 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!)
Toutes les suggestions ??? merci d'avance!
La solution
Essayez de supprimer les espaces après NOPASSWD. , Vous pouvez aussi mettre toutes les commandes sur une seule ligne.
invitado ALL = NOPASSWD: /usr/bin/aptitude, /usr/bin/X11/wireshark, /usr/bin/wireshark, /usr/sbin/traceroute, /usr/sbin/tcpdump
Edit:
De plus, je pense que /usr/bin/aptitude/usr/bin/X11/wireshark
était probablement faux. Cela devrait être 2 commandes, /usr/bin/aptitude
et /usr/bin/X11/wireshark
.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow