1

My user is already in 'wheel' group of CentOS and the 'ping' command doesn't work:

ping: socket: Operation not permitted

A guide here about using 'chmod +s' for 'ping':
https://github.com/MichaIng/DietPi/issues/1012#issuecomment-532840857

However, I saw another command 'chmod g+s', how does it differ from 'chmod +s'?

1 Answer 1

4

chmod +s sets both the UID and GID bits, while chmod g+s sets only the GID bit (and chmod u+ssets only the UID).

UID and GID bit lets the program run as the owner and/or the owner's group - rather than as the user and group of who actually started it. For example, a program may always run as if it had been started by root.

Lets say you have a file with ownership root:adm... chmod g+swould give the program access to some logs (bad?)... chmod +s would in addition let the program run with full root privileges (much much worse!).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.