分享

ping: icmp open socket: Operation not permitted 的解决办法

 dwlinux_gs 2015-11-30

ping: icmp open socket: Operation not permitted 的解决办法

简介:
ping: icmp open socket: Operation not permitted 的解决办法


为 ping 加上 suid 即可。

yyc@localhost ~ $ sudo route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.190.40.0 * 255.255.254.0 U 2 0 0 eth0
loopback localhost 255.0.0.0 UG 0 0 0 lo
default 10.190.40.1 0.0.0.0 UG 2 0 0 eth0

yyc@localhost ~ $ ping 10.190.40.1

简介:
ping: icmp open socket: Operation not permitted 的解决办法


为 ping 加上 suid 即可。

yyc@localhost ~ $ sudo route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.190.40.0 * 255.255.254.0 U 2 0 0 eth0
loopback localhost 255.0.0.0 UG 0 0 0 lo
default 10.190.40.1 0.0.0.0 UG 2 0 0 eth0

yyc@localhost ~ $ ping 10.190.40.1
ping: icmp open socket: Operation not permitted

yyc@localhost ~ $ ls -l /bin/ping
-rwxrwxrwx 1 root root 34628 9月 2 12:15 /bin/ping

yyc@localhost ~ $ sudo chmod u+s /bin/ping

yyc@localhost ~ $ ls -l /bin/ping
-rwsrwxrwx 1 root root 34628 9月 2 12:15 /bin/ping

yyc@localhost ~ $ ping 10.190.40.1
PING 10.190.40.1 (10.190.40.1) 56(84) bytes of data.
64 bytes from 10.190.40.1: icmp_req=1 ttl=255 time=0.871 ms
64 bytes from 10.190.40.1: icmp_req=2 ttl=255 time=0.865 ms
^C
--- 10.190.40.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.865/0.868/0.871/0.003 ms


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多