• May 22, 2012, 10:25:59 PM
Welcome, Guest. Please login or register. Registration is free.
Did you miss your activation email?

Author Topic: CentOS running tcpdump -w -C results in permission denied  (Read 1226 times)

0 Members and 1 Guest are viewing this topic.

Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 2517
    • Michael McNamara
CentOS running tcpdump -w -C results in permission denied
« on: May 04, 2011, 10:49:39 PM »
I had an interesting issue tonight... I needed to perform a packet capture of a Linksys PAP. I used the second NIC in my CentOS 5.5 test server but I needed to setup tcpdump so it would continually write the packet capture to disk for 24 - 48 hours. I tried the following command line arguements;

tcpdump -s0 -i eth1 host 192.168.1.7 -w linksys.pcap -C 10

And I received the following error message;

tcpdump: WARNING: eth1: no IPv4 address assigned
tcpdump: linksys.pcap: Permission denied


The first error message can be safely ignored. I run eth1 as a stealth NIC with no IP interface attached to it so my packet captures will be clean. The second error message left me scratching my head, "Permission denied" really?

It took me a second or two to realize that tcpdump was (by default) changing user contexts from root to the user pcap. The user pcap didn't have rights to the filesystem I was in. I made a new directory with the appropriate rights and I was off and running.

What was supposed to take 60 seconds took 10 minutes...

Cheers!

We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!