运行“tcpdump -w 1.pcap”时需要限制文件大小。我尝试使用键“-C”来执行此操作,但是当我添加它时,我收到错误“权限被拒绝”。所以:
> sudo tcpdump -w 1.pcap
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
^C821 packets captured
847 packets received by filter
24 packets dropped by kernel
但:
> sudo tcpdump -C 100 -w 1.pcap
tcpdump: 1.pcap: Permission denied
我从我的主目录运行命令,并尝试在以不同权限运行命令之前删除并创建文件,最后我有:
-rwxrwxrwx 1 root root 0 Aug 5 10:30 1.pcap
或者
-rwxrwxrwx 1 fd8 users 0 Aug 5 10:30 1.pcap
您能否建议为什么在第二种情况下我无法写入文件?