Linux Packet Loss: Fix “Operation not permitted” When Pinging from Host

 Problem Description (CentOS):
      On a Linux system, a regular user running the ping command returns the error “ping: icmp open socket: Operation not permitted”, but the root user can use the command normally.


 
    Cause Analysis:
    The ping command uses the ICMP protocol during execution and needs to send ICMP packets. However, only the root user can create ICMP packets. Under normal circumstances, the ping command’s permissions should be -rwsr-xr-x, meaning it has the suid bit set. Once this permission is modified, regular users cannot use the command normally.
 
    Solution:
    As the root user, execute “chmod u+s /bin/ping”.

    Additionally, in my test environment, I found significant packet loss when pinging the host IP from an external network. My approach was to disable the firewall, which resolved the issue. I’m not sure if the packet loss was related to the firewall, but I’m sharing this here for reference in troubleshooting.

Leave a Comment

Your email address will not be published.