2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

2022-07-27 ping: socket: Operation not permitted

Posted at

環境

発生した事象

Rocky Linux 環境を Vagrant box で作成し、 vagrant ユーザで SSH ログインして ping コマンドを実行したところ、「ping: socket: Operation not permitted」というエラーが出た。

root ユーザで実行したところ成功した。

[vagrant@localhost ~]$ ping -c1 8.8.8.8
ping: socket: Operation not permitted

[vagrant@localhost ~]$ sudo su -
Last login: Wed Jul 27 06:56:51 UTC 2022
[root@localhost ~]# ping -c1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=15.3 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 15.282/15.282/15.282/0.000 ms

解決方法

chmod 4711 /usr/bin/ping

とコマンドを実行したところ、事象が解消された。

[root@localhost ~]# ls -l /usr/bin/ping
-rwxr-xr-x. 1 root root 67656 Apr 19 23:11 /usr/bin/ping
[root@localhost ~]# chmod 4711 /usr/bin/ping
[vagrant@localhost ~]$ ping -c1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=16.2 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 16.238/16.238/16.238/0.000 ms
[vagrant@localhost ~]$ 

How to fix – ping: socket: Operation not permitted | Incredigeek

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?