Linux – tcpdump can’t open file: permission denied (linux)

linuxtcpdump

I set all filters for Tcpdump in a config file, but when I run this command:

sudo tcpdump  -i any -w "./mypcap.pcap" -F "myfilters.txt"

I get permission denied although my file has rwx for users, groups, and others. What am I doing wrong?

Best Answer

You're probably in a directory that can't be written to, such as /proc, or an NFS mounted directory with root_squash. Change to a writable directory and try again, or direct your output file to a writable directory.