ping: icmp open socket: Operation not permitted 的解決辦法:為ping加上suid即可。
報錯時ping的屬性:
[root@localhost ~]# ls -l /usr/bin/ping
-rwxr-xr-x 1 root root 44896 Mar 23 18:06 /usr/bin/ping
給ping加上suid:
[root@localhost ~]# chmod u+s /usr/bin/ping
[root@localhost ~]$ ls -l /usr/bin/ping
-rwsr-xr-x 1 root root 44896 Mar 23 18:06 /usr/bin/ping
然后就能正常執行了。