How to enable Wireshark without running as root in Trusty 14.04

154,880

Solution 1

I found that after running:

sudo dpkg-reconfigure wireshark-common

a wireshark group been created in /etc/gshadow. So I just wrote:

sudo gpasswd -a $USER wireshark

and logout/login and now it works fine!

Solution 2

Yes, you did correct. But some thing is missing.If you see the error message like couldn't run /usr/bin/dumpcap in child process: Permission Denied.Go to terminal and

sudo dpkg-reconfigure wireshark-common

choose answer as "YES" .Then add user to the group by

sudo adduser $USER wireshark

Then restart your machine and open wireshark. It works.

Solution 3

sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap

Check this question

Share:
154,880

Related videos on Youtube

Janghou
Author by

Janghou

Updated on September 18, 2022

Comments

  • Janghou
    Janghou over 1 year

    I installed Wireshark. Running as root is not recommended, so

    I Did

    sudo dpkg-reconfigure wireshark-common
    

    According to:

    http://wiki.wireshark.org/CaptureSetup/CapturePrivileges

    http://anonscm.debian.org/viewvc/collab-maint/ext-maint/wireshark/trunk/debian/README.Debian?view=markup

    Answered Yes, Logout out Started Wireshark and got this message:

    couldn't run /usr/bin/dumpcap in child process: Permission Denied.
    

    I think I followed the recommended way of configuring Wireshark, it worked in 13.10, it doesn't in 14.04

    FYI, reconfiguring wireshark-common is actually setting the group for dumpcap to Wireshark. Still it doesn't work. I checked that.

    How should it be done in 14.04?

    • Akronix
      Akronix about 10 years
      I guess you've already checked that you, the user, are in the wireshark group
    • Janghou
      Janghou about 10 years
      Yes. that said, I stumble on this groups $USER does list wireshark groups $user does NOT list wireshark
    • Eric Carvalho
      Eric Carvalho about 9 years
    • l3x
      l3x over 5 years
      Simply run this: sudo usermod -aG wireshark $USER. Then, log out and back in again.
  • Francisco Corrales Morales
    Francisco Corrales Morales almost 8 years
    Now I can see all the Interfaces, but the error messages still showing up when the program is starting.
  • heemayl
    heemayl almost 8 years
    You don't have to restart. Logging out/in would do.
  • Thanos
    Thanos over 7 years
    Don't forget to add the "-a" parameter to the adduser command. -a, --add USER add USER to GROUP
  • TmTron
    TmTron about 7 years
    I had to restart - login/out did not work (ubuntu 16.10-64bit)
  • Hack-R
    Hack-R over 6 years
    Three cheers. This should be marked as the solution but OP probably abandoned the thread.
  • Nicolas Raoul
    Nicolas Raoul almost 6 years
    Instead of logout/login, just type newgrp wireshark as your normal user, it is faster, and works the same in my experience with 18.04.
  • Abhay Sehgal
    Abhay Sehgal about 5 years
    Yeah it works, can you please explain above commands in detail, or can provide any link?
  • Abhay Sehgal
    Abhay Sehgal about 5 years
    Yeah it works, can you please explain above commands in detail, or can provide any link?
  • Detained Developer
    Detained Developer over 4 years
    Works 101% Thanks!