LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-22-2017, 09:26 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 761

Rep: Reputation: Disabled
Permission to capture on device for non-root user (tshark)


How do I use tshark as a user other than root? I added "wireshark" group to the user, but no change. Thanks
Code:
[Michael@devserver ~]$ sudo tshark -i wlan0 -f "udp port 47808"
Running as user "root" and group "root". This could be dangerous.
Capturing on wlan0
^C0 packets captured
[Michael@devserver ~]$ tshark -i wlan0 -f "udp port 47808"
Capturing on wlan0
tshark: The capture session could not be initiated (You don't have permission to capture on that device).
Please check to make sure you have sufficient permissions, and that you have the proper interface or pipe specified.
0 packets captured
[Michael@devserver ~]$ groups
Michael wheel wireshark www phped
[Michael@devserver ~]$
 
Old 01-22-2017, 09:50 AM   #2
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,112
Blog Entries: 3

Rep: Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003
There are some instructions provided by tshark itself here:
Alternatively, you could also run the capture through tcpdump instead. In that way you could either save to a file and then analyze the file's contents or else capture directly via some bash tricks known as process substitution.

Code:
sudo tcpdump -i eth0 -w foo.pcap; 
tshark -r foo.pcap;

# or

tshark -r <( sudo tcpdump -i eth0 -w - )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Permission on a device for another user EduPorteņo Ubuntu 6 07-22-2013 07:00 AM
Can tshark run under none root permission? fantasy1215 Linux - Newbie 1 11-03-2011 09:30 PM
tshark - save capture packet to txt file varun.sharma Linux - Software 5 09-17-2009 12:04 PM
mounting any device in fstab = Permission denied when trying to cd without root. Romanus81 Slackware 5 06-03-2008 11:24 PM
Giving a user root permission via the root group louisb Linux - Security 6 07-23-2007 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration