ping: => missing cap_net_raw+p capability or setuid?
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
After an upgrade, normal user could not do ping anymore, though root/sudo still could, result was this error:

:: Code ::
ping google.com
ping: socktype: SOCK_RAW
ping: socket: Operation not permitted
ping: => missing cap_net_raw+p capability or setuid?


Following this thread: www.suse.com/support/kb/doc/?id=000020581
:: Quote ::
2. Alternatively, non-root users can use the ping command if certain capabilities are present on the /usr/bin/ping binary:
node1:~ # setcap cap_net_raw+p /usr/bin/ping
node1:~ # getcap /usr/bin/ping
/usr/bin/ping = cap_net_raw+p


I did, as root:

:: Code ::
# setcap cap_net_raw+p /usr/bin/ping
# getcap /usr/bin/ping
/usr/bin/ping cap_net_raw=p

# then as non root, regular user:
ping google.com
PING google.com(sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e)) 56 data bytes
64 bytes from sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e): icmp_seq=1 ttl=114 time=3.05 ms
64 bytes from sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e): icmp_seq=2 ttl=114 time=3.09 ms


and it all works again. Not sure what happened there.

:: Code ::
inxi -SnIMz
System:
  Kernel: 6.6.11-1-liquorix-amd64 arch: x86_64 bits: 64
  Desktop: Xfce v: 4.18.1 Distro: Debian GNU/Linux trixie/sid
Machine:
  Type: Desktop System: Gigabyte product: X470 AORUS ULTRA GAMING v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: X470 AORUS ULTRA GAMING-CF
    serial: <superuser required> BIOS: American Megatrends LLC. v: F62d
    date: 10/13/2021
Network:
  Device-1: Intel I211 Gigabit Network driver: igb
  IF: enp8s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: vboxnet0 state: down mac: <filter>
Info:
  Memory: total: N/A available: 31.27 GiB used: 5.4 GiB (17.3%)
  Processes: 546 Uptime: 33m Shell: Bash inxi: 3.3.32

Back to top
Display posts from previous:   

All times are GMT - 8 Hours