【エラー】ラズベリーパイでpingを実行すると「ping: icmp open socket: Operation not permitted」と表示されて実行できない

スポンサーリンク

コンテンツ

調べてみると、pingコマンドにsuidがセットされていないみたいです。ラズベリーパイ2のraspbian-jessieで確認。

エラー時の様子

pi@raspberrypi:~ $ ping raspberrypi.local
ping: icmp open socket: Operation not permitted

対策

pingコマンドにsuidをセットするとOKでした

sudo chmod u+s /bin/ping

対策後の様子

pi@raspberrypi:~ $ ping raspberrypi.local -c 5
PING raspberrypi.local (192.168.1.X) 56(84) bytes of data.
64 bytes from 192.168.1.X: icmp_seq=1 ttl=64 time=0.140 ms
64 bytes from 192.168.1.X: icmp_seq=2 ttl=64 time=0.105 ms
64 bytes from 192.168.1.X: icmp_seq=3 ttl=64 time=0.115 ms
64 bytes from 192.168.1.X: icmp_seq=4 ttl=64 time=0.131 ms
64 bytes from 192.168.1.X: icmp_seq=5 ttl=64 time=0.089 ms

--- raspberrypi.local ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3998ms
rtt min/avg/max/mdev = 0.089/0.116/0.140/0.018 ms

メモメモφ(..)