为什么 busybox ping 需要 root?

为什么 busybox ping 需要 root?

为什么 busybox ping 需要 root?

$ ping dec.com -c1
PING dec.com (216.239.32.21) 56(84) bytes of data.
64 bytes from any-in-2015.1e100.net (216.239.32.21): icmp_seq=1 ttl=119 time=54.9 ms

--- dec.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 54.855/54.855/54.855/0.000 ms
$ busybox  ping dec.com -c1
PING dec.com (216.239.34.21): 56 data bytes
ping: permission denied (are you root?)

答案1

如果它是外部版本,只要它具有 CAP_NET_RAW 功能或 setuid,它就应该可以工作,但在这种情况下,busyboxping内置的,因此您必须以 身份运行 busybox root

如果存在,您可以尝试执行外部版本,/usr/bin/ping或者/bin/ping

相关内容