Mac OS Ping:Ping必须以root用户身份运行

时间:2018-08-26 03:03:24

标签: macos root ping

mac os 10.13.6 iterm3终端

➜ ping baidu.com 
ping: ping must run as root

但何时:

➜ sudo ping baidu.com   
PING baidu.com (220.181.57.216): 48 data bytes   
56 bytes from 220.181.57.216: icmp_seq=0 ttl=54 time=59.912 ms   
56 bytes from 220.181.57.216: icmp_seq=1 ttl=54 time=48.389 ms

没关系。

如何使ping正常?

2 个答案:

答案 0 :(得分:2)

有效!

➜ sudo chown root /usr/local/bin/ping
➜ sudo chmod +s /usr/local/bin/ping
➜ ping baidu.com

答案 1 :(得分:0)

添加到您的zshrc

 export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"