Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have such trouble when using ping under root:

ping: icmp open socket: Operation not permitted

What does it mean? When I try ls -l /bin/ping it says:

-rwsr-xr-x 1 root root 30788 Jul 27  2010 /bin/ping

I'm using Debian GNU/Linux 5.0

share|improve this question

After few search I found setcap and :

setcap cap_net_raw=ep $(which ping)
share|improve this answer
I had that problem with the default installation of SparkyLinux (facepalm). Zulu's solution fixed it. – msb Aug 10 '14 at 2:00
I had this with a Debian chroot inside an Ubuntu 14.04, and executing this to the debian executable while not chroot'ed fixed it. – Vargas Nov 3 '15 at 14:19
This fixed the problem on Raspbian 8. – user46935 Jan 1 at 16:34

You might have an iptables rule preventing pings from getting to localhost (this is entirely possible with iptables).

The following will clear all iptables rules. Do this cautiously because iptables is used to implement firewalling on Linux, so you are effectively disabling your firewall.

iptables -P INPUT ACCEPT
iptables -F
iptables -X

This could happen if your route table is messed up, I believe, as well. Give us the output of route if the above leads nowhere.

The only other thing I can think of is that you have lo, the localhost "virtual network adapter", involved in some weird bridging configuration with another adapter. But this is highly unlikely (but you can use brctl to check).

share|improve this answer
I have real IP that's why I don't want to open totally computer to world in case of clearing iptables. ifconfig says besides lo: lo:4 Link encap:Local Loopback inet Mask: UP LOOPBACK RUNNING MTU:16436 Metric:1. brctl not found. – massimo May 25 '11 at 18:41
# iptables --list FATAL: Could not load /lib/modules/2.6.34-vs2. No such file or directory iptables v1.4.2: can't initialize iptables table filter': Permission denied (you must be root) – massimo May 25 '11 at 18:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .