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.