User avatar
Milliways
Posts: 700
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

ping suid permission

Tue May 11, 2021 12:00 am

I was working on some scripts and ping was failing with error:-

Code: Select all

ping: socket: Operation not permitted
I checked the permissions and found

-rwxr-xr-x 1 root root 55720 2020-01-14 10:29 /bin/ping*

I am sure it used to work and I can't recall changing anything.

On older OS ping had suid permissions - has there been any change, and if so why?

cleverca22
Posts: 3792
Joined: Sat Aug 18, 2012 2:33 pm

Re: ping suid permission

Tue May 11, 2021 12:12 am

Code: Select all

root@pi400:~# stat /bin/ping
  File: /bin/ping
  Size: 55720           Blocks: 112        IO Block: 4096   regular file
Device: b302h/45826d    Inode: 3090        Links: 1
Access: (4755/-rwsr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-12-02 09:02:04.073953738 -0400
Modify: 2020-01-13 19:29:01.000000000 -0400
Change: 2020-12-02 09:02:04.073953738 -0400
 Birth: -
it probably still needs to be 4755, maybe you ran a chmod 755 /bin/* at some point?

User avatar
jojopi
Posts: 3477
Joined: Tue Oct 11, 2011 8:38 pm

Re: ping suid permission

Tue May 11, 2021 12:40 am

Modern distros use capabilities instead of setuid.

Code: Select all

pi@tau:~ $ getcap /bin/ping
/bin/ping = cap_net_raw+ep
Did you install or copy the root filesystem in an unusual way, that could cause the capability to be omitted?

cleverca22
Posts: 3792
Joined: Sat Aug 18, 2012 2:33 pm

Re: ping suid permission

Tue May 11, 2021 1:15 am

jojopi wrote:
Tue May 11, 2021 12:40 am
Modern distros use capabilities instead of setuid.

Code: Select all

pi@tau:~ $ getcap /bin/ping
/bin/ping = cap_net_raw+ep
Did you install or copy the root filesystem in an unusual way, that could cause the capability to be omitted?
ah, ive got a ~7 year old install i think, so my apt hasnt migrated things to the new style

MiscBits
Posts: 249
Joined: Wed Jan 27, 2021 12:48 pm

Re: ping suid permission

Tue May 11, 2021 3:41 am

So it's not only me viewtopic.php?f=28&t=311300

My install though was only a couple of months old...
Is a computer language with goto's totally Wirth-less?

User avatar
Milliways
Posts: 700
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

SOLVED: ping suid permission

Tue May 11, 2021 7:55 am

I "fixed" the problem (which was in both my Raspberry Pi OS & Lite installations) with

Code: Select all

apt reinstall inetutils-ping
The cause remains unclear.

MiscBits
Posts: 249
Joined: Wed Jan 27, 2021 12:48 pm

Re: ping suid permission

Tue May 11, 2021 11:39 am

Oddly enough its only happened on one of my boxes here.

Not sure if it was an update or package install - the dev box that got 'hit' gets backed up / restored and hacked about and had a few 'comms' related packages on recently as I'm coding MQTT / Telnet / and web scraping bits.

Like you, a re-install fixed it.
Is a computer language with goto's totally Wirth-less?

Return to “Raspberry Pi OS”