eu tentei no Centos 5, ainda o mesmo, mesmo em tmp ou pasta raiz. Na página do manual tcpdump, os privilégios são descartados quando usados com a opção -Z (ativada por padrão) antes de abrir o primeiro arquivo salvo. porque você especificou "-C 1", a permissão negada ocorre devido ao tamanho do arquivo já atingido 1 e, ao criar um novo arquivo, ele gerará um erro de permissão negada. então apenas especifique o usuário -Z
# strace tcpdump -i eth0 -n -w out.pcap -C 1
fstat(4, {st_mode=S_IFREG|0644, st_size=903, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aea31934000
lseek(4, 0, SEEK_CUR) = 0
read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 903
read(4, "", 4096) = 0
close(4) = 0
munmap(0x2aea31934000, 4096) = 0
setgroups(1, [77]) = 0
setgid(77) = 0
setuid(77) = 0
setsockopt(3, SOL_SOCKET, SO_ATTACH_FILTER, "# grep 77 /etc/group
pcap:x:77:
# grep 77 /etc/passwd
pcap:x:77:77::/var/arpwatch:/sbin/nologin
# man tcpdump
-C Before writing a raw packet to a savefile, check whether the file is currently larger than file_size and, if so,
close the current savefile and open a new one. Savefiles after the first savefile will have the name specified
with the -w flag, with a number after it, starting at 1 and continuing upward. The units of file_size are mil-
lions of bytes (1,000,000 bytes, not 1,048,576 bytes).
**Note that when used with -Z option (enabled by default), privileges are dropped before opening first savefile.**
# tcpdump --help
tcpdump version 3.9.4
libpcap version 0.9.4
Usage: tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ]
[ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]
[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
[ -W filecount ] [ -y datalinktype ] [ -Z user ]
[ expression ]
# tcpdump -i eth0 -n -w out.pcap -C 1 -Z root
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
35 packets captured
35 packets received by filter
0 packets dropped by kernel
# strace tcpdump -i eth0 -n -w out.pcap -C 1
fstat(4, {st_mode=S_IFREG|0644, st_size=903, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aea31934000
lseek(4, 0, SEEK_CUR) = 0
read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 903
read(4, "", 4096) = 0
close(4) = 0
munmap(0x2aea31934000, 4096) = 0
setgroups(1, [77]) = 0
setgid(77) = 0
setuid(77) = 0
setsockopt(3, SOL_SOCKET, SO_ATTACH_FILTER, "# grep 77 /etc/group
pcap:x:77:
# grep 77 /etc/passwd
pcap:x:77:77::/var/arpwatch:/sbin/nologin
# man tcpdump
-C Before writing a raw packet to a savefile, check whether the file is currently larger than file_size and, if so,
close the current savefile and open a new one. Savefiles after the first savefile will have the name specified
with the -w flag, with a number after it, starting at 1 and continuing upward. The units of file_size are mil-
lions of bytes (1,000,000 bytes, not 1,048,576 bytes).
**Note that when used with -Z option (enabled by default), privileges are dropped before opening first savefile.**
# tcpdump --help
tcpdump version 3.9.4
libpcap version 0.9.4
Usage: tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ]
[ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]
[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
[ -W filecount ] [ -y datalinktype ] [ -Z user ]
[ expression ]
# tcpdump -i eth0 -n -w out.pcap -C 1 -Z root
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
35 packets captured
35 packets received by filter
0 packets dropped by kernel
%pre%%pre%%pre%%pre%07k%pre%%pre%%pre%%pre%%pre%", 16) = 0
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
recvfrom(3, 0x7fff9563d35f, 1, 32, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
fcntl(3, F_SETFL, O_RDWR) = 0
setsockopt(3, SOL_SOCKET, SO_ATTACH_FILTER, "%pre%%pre%%pre%%pre%%pre%%pre%P73%pre%%pre%%pre%%pre%", 16) = 0
open("out.pcap", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
write(2, "tcpdump: ", 9tcpdump: ) = 9
write(2, "out.pcap: Permission denied", 27out.pcap: Permission denied) = 27
write(2, "\n", 1
) = 1
exit_group(1) = ?
%pre%%pre%%pre%07k%pre%%pre%%pre%%pre%%pre%", 16) = 0
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
recvfrom(3, 0x7fff9563d35f, 1, 32, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
fcntl(3, F_SETFL, O_RDWR) = 0
setsockopt(3, SOL_SOCKET, SO_ATTACH_FILTER, "%pre%%pre%%pre%%pre%%pre%%pre%P73%pre%%pre%%pre%%pre%", 16) = 0
open("out.pcap", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
write(2, "tcpdump: ", 9tcpdump: ) = 9
write(2, "out.pcap: Permission denied", 27out.pcap: Permission denied) = 27
write(2, "\n", 1
) = 1
exit_group(1) = ?
você pode ver o resultado strace acima, o tcpdump removeu os privilégios para o usuário e grupo pcap (77).
%pre%Da página man do tcpdump, -C
%pre%Especifique usuário específico com -Z usuário
%pre%