Home:ALL Converter>How to capture MQTT data locally in SSH remote server using Wireshark?

How to capture MQTT data locally in SSH remote server using Wireshark?

Ask Time:2021-05-15T21:17:59         Author:ismsm

Json Formatter

I want to capture MQTT packets on the SSH Linux-based remote server using Wireshark from my home. I can capture data go out through the Internet, such as when I use this command line mosquitto_pub -h test.mosquitto.org -t topic -m "Hello", I can see the packets in Wireshark. But, When I publish data in localhost, such as using this command mosquitto_pub -d -h localhost -t hello/world -m "75" I can't see any packets in Wireshark. I want to make a client/server in the same remote server.

I use this command to open Wireshark:

sudo ssh [email protected] tcpdump -U -s0 -w - | wireshark -k -i -

I know only a basic thing in Wireshark, so please how I solve this?

Author:ismsm,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67547125/how-to-capture-mqtt-data-locally-in-ssh-remote-server-using-wireshark
yy