Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I use tcpdump on centos 6, I got a permission denied error even when I was root. My command is like this:

sudo tcpdump -i eth0 -G 10 -w test.dmp port 80

i have tried with -Z root or -Z my_username but no luck

sudo tcpdump -i eth0 -Z root -G 10 -w test.dmp port 80
sudo tcpdump -i eth0 -Z myuser_name -G 10 -w test.dmp port 80

Does anybody know how to make it work?

share|improve this question
Could you please show us the full output? – quanta Sep 4 '12 at 16:15
the first file is created fine but when it tried to create a second file, it error with this error: tcpdump: test.dmp: Permission denied – Sean Nguyen Sep 4 '12 at 16:26
I found a bug report for it but i can't find a solution. I am using centos 6. – Sean Nguyen Sep 4 '12 at 16:28
Which tcpdump version are you using? – quanta Sep 4 '12 at 17:00
Could you be starting the second process a little early such that the file is still open in the first tcpdump while trying the second dump. Maybe a sleep 1 between the two invokations might help. – mdpc Sep 4 '12 at 19:34

If you plan to use file rotation, make sure the directory you write into is world writable.

tcpdump drops privileges shortly after opening the first file specified for writing with -w, so it will not be able to write to a directory if:

  1. it doesn't own or isn't a part of the owning group of the directory or
  2. that directory is not world-writable.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.