Ubuntu 14.04 – ping icmp open socket operation not permitted

Recently when I am trying to do ping got following exception:

$ ping host.example.com


ping: icmp open socket: Operation not permitted

Reason for the issue:

On Linux (and other flavours) you have to be root to open up a socket. The SUID bit must be set in the ping binary to allow it to open sockets. This issue is common on jailing users as most disto’s ping binary will have this set by default.

Set the SUID bit:

chmod u+s bin/ping

Now check SUID bit:

ls -la bin/ping

-rwsr-xr-x 1 root root 41704 2011-04-06 15:13 bin/ping
Now you can try ping command, it should work without any issue.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s