[wplug] File Permissions

Rick Smith rick at rbsmith.com
Thu Apr 3 11:38:43 EST 2003


On Thu, Apr 03, 2003 at 11:21:49AM -0500, Weber, Larry A wrote:
> Can anyone explain what an "s" file permission is, and how it differs from
> "x"?  The man page for chmod isn't very helpful.

's'et user ID / group id

but they didn't have a place to put it, so they put it on top of the 'x'.
so if you see 's', then that also means 'x'.  If you see upper case 'S',
then that means 'x' is not set.  It doesn't really have anything to do
with 'x' bit.

Example use in two place:

On directory, to set group id: chmod g+s mydir
then when ever I'm in mydir and make a directory, the group used
will be inherited from mydir and not my default group.

On executables, chmod u+s prog 
means that when anyone runs prog, they will run as you.
Handy for logging in as root, and changing things.
Like 'su -; chmod u+s /bin/bash' then lets anybody who runs
bash have root privelages :)
But they you get into effective and real users, and confusion returns.

- Rick



More information about the wplug mailing list