[Solved] PING - the next mystery in my journey

General support questions
lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

[Solved] PING - the next mystery in my journey

Post by lightman47 » 2018/03/01 17:01:17

Background: I'd previously messed up permissions on my system and pretty much got them straightened out - details here:
viewtopic.php?f=47&t=66089

I just tried to PING on my network and got

Code: Select all

ping: socket: Operation not permitted
When I 'ping'ed as root, all is well. I then did a 'locate' for ping and found it in /usr/bin. Investigation revealed the permissions are root:root - the same as on other network machines (through which I can ping as an ordinary user).

Where do I need to start looking for the permission error, if anyone knows?

Thank you so much.

P.S. Yes - I have several times considered a rebuild (done it a number of times) but this laptop has so much going on that's it's still easier to fix things as they turn up. BTW - if this doesn't get fixed, I can just sudo ping, but it would be nice to have it working.
Last edited by lightman47 on 2018/03/02 14:14:42, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: PING - the next mystery in my journey

Post by TrevorH » 2018/03/01 17:10:10

How have you tried to correct the permissions? The correct way to do it for all files/directories that are owned by rpm packages that are installed is to run something like:

for p in $(rpm -qa); do rpm --setperms $p; rpm --setugids $p; done

That loops through all packages that are installed and runs rpm --setperms and rpm --setugids for each package $p in turn. That should reset them all to how they were shipped but it may also break things if you have manually changed the ownership/permission of rpm owned directories and files but then those would have broken next time you upgraded that package anyway.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: PING - the next mystery in my journey

Post by lightman47 » 2018/03/01 17:33:59

Following your advice in a previous post I did "for p in $(rpm -qa); do rpm --setperms $p; rpm --setugids $p; done"

As mentioned in the history, if fixed TONS of my problems, and I am grateful. It also created some MINOR problems, like this one, that I stumble into time to time. As the problems aren't devastating and I have time, I am ok with posting questions here and waiting for suggestions if they arrive. (And thank you for that).
but it may also break things if you have manually changed the ownership/permission of rpm owned directories and files but then those would have broken next time you upgraded that package anyway
OH! That's likely what happened iff they're under "/var". Explains a lot.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: PING - the next mystery in my journey

Post by lightman47 » 2018/03/01 17:43:00

Is there an easy way out of this (like a yum clean all or similar) and then a re-run of your command?

Or is it "bad news"? Heh.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: PING - the next mystery in my journey

Post by TrevorH » 2018/03/01 18:59:27

What's the output from ls -laZ /etc/nss*
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: PING - the next mystery in my journey

Post by lightman47 » 2018/03/01 19:17:33

Ha - never thought of Selinux. That said:

Code: Select all

sudo ls -laZ /etc/nss*
-rw-r--r--. root root system_u:object_r:etc_t:s0       /etc/nsswitch.conf
-rw-r--r--. root root system_u:object_r:etc_t:s0       /etc/nsswitch.conf.bak
-rw-r--r--. root root system_u:object_r:etc_t:s0       /etc/nsswitch.conf.rpmnew
a second (without sudo) was identical

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: PING - the next mystery in my journey

Post by aks » 2018/03/01 20:19:46

Is there an easy way out of this (like a yum clean all or similar)
Nope. You've cocked up so much. Seriously, ping is a "priv" thing like - it's a "raw" socket. Lord know what else is cocked up.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: PING - the next mystery in my journey

Post by lightman47 » 2018/03/01 20:51:34

POOP - I was hoping for better news.
K - will return from a trip in a couple weeks - to rebuild my 'key' laptop.

Thank you.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: PING - the next mystery in my journey

Post by hunter86_bg » 2018/03/01 22:13:50

Sometimes this one works (if you have all the repos enabled):

Code: Select all

yum reinstall "*"

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: PING - the next mystery in my journey

Post by TrevorH » 2018/03/01 23:23:10

ping comes from the package 'iputils' so does rpm -V iputils report any output? It shouldn't.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply