You are not logged in.

#1 2014-08-22 01:56:50

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 275

[Solved] ping requires root privilages but only if OS run from RAM

I have an odd situation where I can use ping as a regular user from openbox's autostart if I run the OS from storage disks but not if I load the OS into RAM. It only works for a regular user with the OS loaded to RAM when I set the sticky bit.

Can this be a timing problem with systemd not activating a required service in time?

Last edited by KairiTech (2014-08-26 21:16:45)

Offline

#2 2014-08-26 03:08:54

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] ping requires root privilages but only if OS run from RAM

Whatever you're using to copy to RAM must not preserve capabilities. ping relies on having cap_net_admin (for SOCK_RAW) in order for non-root users to make use of it.

Last edited by falconindy (2014-08-26 13:54:33)

Offline

#3 2014-08-26 20:03:26

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 275

Re: [Solved] ping requires root privilages but only if OS run from RAM

Yep! That's it exactly. I create a root file system archive to speed the loading into RAM. See the exact code below:

sudo tar -vzcf /rootfs.tar.gz / --exclude={/rootfs.tar.gz,/boot/*,/var/cache/pacman/pkg/*,/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

Adding the --xattrs option to tar solved it.

Last edited by KairiTech (2014-08-26 21:17:46)

Offline

#4 2024-03-18 23:18:29

dulinux
Member
Registered: 2023-08-19
Posts: 1

Re: [Solved] ping requires root privilages but only if OS run from RAM

I was having this issue in an archlinux incus container image.

This solved the issue:

setcap 'cap_net_raw+p' /usr/bin/ping

Offline

#5 2024-03-19 02:12:47

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,803

Re: [Solved] ping requires root privilages but only if OS run from RAM

Closing this 10 year old thread


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB