32

I'm trying to use wireshark on a Debian machine, but when I run it with my non-root user account, it doesn't detect any network interface.

I also tried running wireshark as root, but wireshark tells me this method is insecure.

I also read the FAQ and found "read the file on /usr/shared/wireshark-common/README.Debian file" - I did read that file, but I still don't know what I'm supposed to do.

slhck
  • 235,242

3 Answers3

52

The file is actually /usr/share/doc/wireshark-common/README.Debian.

What you need to do is:

sudo dpkg-reconfigure wireshark-common

Choose the "yes" option.

usermod -a -G wireshark your-user-name

Logout and log back in to pick up the new group membership and you can now run wireshark as a non-root user.

Indrek
  • 24,874
notfred
  • 521
  • 1
  • 4
  • 2
18

Note: See the answer by notfred for the correct way to do this under Debian!

I can't delete this because it's accepted.


You need root privileges to capture traffic with Wireshark (or dumpcap, for that matter). According to the manual you mentioned, it should be possible to add your user to the wireshark group though:

useradd -G wireshark your-user-name

Don't know if that alone will work though. Here's also a guide from Wireshark Blog that explains it a bit more:

sudo -s
groupadd -g wireshark
usermod -a -G wireshark your-user-name
chgrp wireshark /usr/bin/dumpcap
chmod 4750 /usr/bin/dumpcap

You may need to log out, and back in for the changes to take effect.

That being said, you can safely run Wireshark to inspect, edit or filter packet dumps without root privileges.

slhck
  • 235,242
1

I think it's a problem with the Wireshark configuration during installation with apt.

When running dpdg-reconfigure wireshark or during installation, it asks Should non-superusers be able to capture packets?. Pressing the left arrow key will make yes(是) marked by red. However, pressing the right arrow key and having no(否) allows non-superusers to capture packets as shown in the image below.

The image of non-superusers choice

Mureinik
  • 4,152