2

If I use setgid (chmod g+s) on a file (not a directory), it turns a dark yellow in the file list (of the particular Linux variant I'm using, anyway). But as far as I know, setgid doesn't actually do anything when applied to non-executable files.

Does it?

And, does anyone have a find command to find all non-directories and remove their setgid bit?

2 Answers 2

3

As you suggest, setgid only applies to executable files and directories.

You can

 find -type f -perm /g+s chmod g-s '{}' \;

Just don't do this in /usr/bin!

1

Neither setuid or setgid have any impact on non-executable files.

Their meaning is that they are executed as though run by the owner of the file, not as the user (or group) running them. What would that mean for a non-executable file?

Regarding finding them, see http://www.faqs.org/faqs/computer-security/most-common-qs/section-15.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .