Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

A standard installation of WireShark doesn't give the program permission to address the network interface. I suppose I have to run the program with SUDO, but do not know how to add it to the icon - if that's the way to do it.

share|improve this question
Are you talking about WireShark? If not, can you link to the application's home page so we can see what you're talking about. Thanks. – Oli Oct 31 '11 at 12:23

2 Answers

up vote 23 down vote accepted

For WireShark there's a better way. The bit that normally needs root is the packet collection application and this can be configured to allow certain people to use it without sudo, gksu, etc.

In a terminal (very important that you're in a terminal, not just the Alt+F2 dialogue) run this:

sudo dpkg-reconfigure wireshark-common

This will ask you if you want to allow non-root user to be able to sniff. That's what we're aiming for, so select Yes and hit return.

This adds a wireshark group. Anybody in that group will be able to sniff without being root. This is obviously more secure than just letting anybody sniff but does mean there's no password checking. Technically any person with access to a computer logged in with a wireshark account will be able to sniff. If that's acceptable to you, carry on.

If not, run that again and select no.

Then you just need to add the user to that group. Run this:

sudo adduser $USER wireshark

And restart or log out. When you're back in it should let you start sniffing without any fuss about being root.

share|improve this answer
Thanks. That was what I'd hoped for :-) – Sven AA Oct 31 '11 at 12:38

You can also run Wireshark with root privileges by running gksu wireshark from the terminal.

share|improve this answer
I just configured it with --enable-setcap-install flag then I can't do this. – Smile Dec 23 '12 at 0:26
This is far more dangerous and more problematic, because there are for more exploitable bugs when running the full gui as root, and configuration issues can crop up when a gui program runs as root. See the dpkg-reconfigure solution above for a much better option. – nealmcb Jan 15 at 23:53
For desktop users, I consider this to be a workaround. When you sudo the app, all files it creates have root permission, and you need to constantly keep changing file permissions to make them available to your current user in your home directory. For server and sysadmins in general, sudo is actually the best approach. – JulioHM Feb 26 at 15:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.