The command specified to tcpdump with the -z option fails with "Permission denied".

Solution Verified - Updated -

Issue

  • To compress the packet capture file, tcpdump can be specified the compress command with the -z option.
  • But the compress command fails with "Permission denied".

    # tcpdump ... -G 30 -Z root -w /logs/dump-%Y%m%d%H%M%S.pcap -z gzip
    tcpdump: listening on ens36, link-type EN10MB (Ethernet), capture size 262144 bytes
    ..snip..
    gzip: /logs/dump-20200625114038.pcap.gz: Permission denied
    
    
    # ls -l /logs/
    total 0
    -rw-r--r-- 1 root root 0 Jun 25 11:40 dump-20200625114038.pcap
    

Environment

  • Red Hat Enterprise Linux 7
  • tcpdump

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content