Wireshark is a very popular protocol analysis software. Naturally you can grab the packet on the net.
sudo apt-get install Wireshark
For security reasons, ordinary users can not open the network card device to grab the packet, Wireshark does not recommend that the user through sudo under root privileges to run,
Wireshark provides a non-root solution for users of Ubuntu (Debian).
(Detailed explanation can be consulted:/usr/share/doc/wireshark-common/readme. Debian)
Specific steps:
sudo dpkg-reconfigure Wireshark-common "should Non-superusers is able to capturepackages?"
Select Yes(default is no)
The Wireshark group appears in Group Policy, and no users belong to the group by default, just add a specific user to the group (you need to log off and log back in for the setting to take effect)
You can run Wireshark real-time capture network packets with that user
Adding users after the Wireshark group
sudo usermod-a-G wireshark $USER