we want to enable real-time network tracing for Application Testing.
We want to grant as little permissions/rights on the remote host that will run tcpdump.
So i tried to setup an authorized key that is used for login.
command="sudo tcpdump -n -i eth0 -s 65535 -w -" ssh-rsa AAAAB3NzaC....
When i connect from the client machine and use
ssh -i private.key user@10.10.254.200 | wireshark -S -k -i -
Wireshark complains and says "unrecognzied pcap format"
When we instead run
ssh -i private.key user@10.10.254.200 "tcpdump -i eth0 -w -" | wireshark -S -k -i -
and remove the command="..." from authorized keys it works!
What is the difference of these two variants? if i remove the "| wireshark..." in both cases i see binary data comming towards me in the terminal...
In case there is a difference that will make this impossible in any case, do you guys know a way where the command can somehow be pre-defined on server side?
As i tried to explain in the beginning, the client machines that run wireshark shall be as restricted as possible.
Thanks for your help!