Note: How to fix Permission denied problem with tcpdump in ubuntu
When I run tcpdump -w client.cap on ubuntu, I got an error:
tcpdump: ./client.cap: Permission denied;
How to solve this problem:
#grep tcpdump /sys/kernel/security/apparmor/profiles:
/usr/sbin/tcpdump (enforce)
#aa-complain /usr/sbin/tcpdump
The program 'aa-complain' is currently not installed. You can install it by typing:
apt-get install apparmor-utils
#apt-get install apparmor-utils
After installation successful:
#aa-complain /usr/sbin/tcpdump
Setting /usr/sbin/tcpdump to complain mode.
Then tcpdump -w client.cap can be launched successfully.