It looks like you may be running the SSH client as root on your local machine. There's probably not a good reason to do that. It violates the principle of least privilege.
As for running
tcpdump on the remote machine, you can craft specific permissions in /etc/sudoers.
Code:
%necs ALL=(root:root) NOPASSWD: /usr/sbin/tcpdump -i wlan0 -w /home/necs/data/t5.pcap
Be careful.
For background, read "man sudoers" and see also "sudo: You're Doing It Wrong"
video or
slides or the book
sudo Mastery by Michael W Lucas.
Then to check on the remote machine whether
tcpdump is running there:
Code:
ssh -i /home/necs/.ssh/id_rsa necs@192.168.14.81 "pgrep tcpdump > /dev/null" \
&& echo "Running" || echo "Not Running"
Or interactively in an SSH session on the remote machine
Code:
ps -o 'uid,pid,ppid,stime,time,cmd' -p $(pgrep tcpdump)