Wireshark in Linux does not need sudo permission to capture bags

Source: Internet
Author: User

Ubuntu installed Wireshark and found that it could not open the network interface. Later, I learned from the Internet that it was okay to run sudo from the command line. However, it was uncomfortable to open a command line window during execution, if you want to directly run the task by clicking the icon, find the following two methods on the Internet: method 1, method 2, method 2, and method 2, suddenly, do you want to restart? After restart, everything is OK!

I don't know which method plays a role, and it may all work. Remember to restart!

 

1. This mainly involves security issues. You can enable the non-superuser mode so that you can directly use normal users to collect packets. The procedure is as follows:

Sudo dpkg-reconfigurewireshark-common)

Sudo adduser yournamewireshark (replace yourname with your own user name)

In this way, you can ~~

 

2.

First, create awireshark Group

 

:~ $ Sudo groupaddwireshark

 

Second, add yourusername to the wireshark Group

 

:~ $ Sudo usermod-a-gwireshark yourusername

 

Third, change groupownership of dumpcap to Wireshark Group

 

:~ $ Sudo chgrpwireshark/usr/bin/dumpcap

 

Fourth, set FilePermissions of dumpcap to 754 (rwx for user, R-X for group)

 

:~ $ Sudo chmod 754/usr/bin/dumpcap

 

Th, enable filecapabilities for dumpcap

 

:~ $ Sudo setcap 'Cap _ net_raw + EIP cap_net_admin + eip'/usr/bin/dumpcap

 

You may also need torun dpkg-reconfigure for wireshark-common if you install Wireshark or tshark ASA package through synaptic and enable packet capture for non-root users

 

:~ $ Sudodpkg-reconfigure wireshark-common

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.