2011-04-27 2 views
1

'invitado'라는 사용자, wireshark, tcpdump 및 traceroute의 일부 바이너리에 대한 사용 권한을 설정하려합니다.wireshark를 사용하기 위해 리눅스 사용자에게 visudo와 함께 사용 권한을 추가하십시오.

# /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를 출력 획득 계속 : IV 난 다음 생각합니다의 sudoers 구문 (syntax)에 따라 수행

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

어떤 제안 ??? 미리 감사드립니다!

답변

9

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이어야합니다.

+0

당신 말이 맞았습니다.이 행에는 두 개의 명령이 포함되어 있습니다. aptitude (적성에 대한 권한 부여에 관심이 없다)에 대한 주석을 달아 모든 명령을 한 줄에 넣고 같은 메시지를 보았습니다 : >>>/etc/sudoers : 28 행 근처의 구문 오류 <<< 지금? ' – Throoze

+0

NOPASSWD (:) 앞의 공백을 제거 했습니까? – glomad

+0

예, didnt work = ( – Throoze