Allows non-root users to capture network data packets using Wireshark

Source: Internet
Author: User

By default, the root permission is required to access the network port, while Wireshark only requires a UI of/usr/share/dumpcap, and/usr/share/dumpcap requires the root permission, therefore, non-root users cannot read the NIC list.

The solution is simple. sudo Wireshark

However, Wireshark does not officially recommend this:

Running as user "root" and group "root ".
This cocould be dangerous.

If you're running Wireshark this way in order to perform live capture, you may be want to be aware that there is a better way too ented

Therefore, use another method to change the group of/usr/share/dumpcap, add a group: Wireshark, chgrp to the wireshark group, and then change the group to the 750 permission to facilitate permission control.

sudo -sgroupadd wiresharkusermod -a -G wireshark <You own username>chgrp wireshark /usr/bin/dumpcapchmod 4750 /usr/bin/dumpcap

Also refer to the online solution and execute the following command

setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap

Getcap/usr/bin/dumpcap is used. The output must be/usr/bin/dumpcap = cap_net_admin, cap_net_raw + EIP.

Note that you must log out to take effect.

Official solutions http://packetlife.net/blog/2010/mar/19/sniffing-wireshark-non-root-user/

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.