December 19, 2009

sgid

Setting the SGID attribute on a directory : chmod g+s

If the SGID (Set Group Identification) attribute is set on a directory, files created in that directory inherit its group ownership.

If the SGID is not set the file's group ownership corresponds to the user's default group.

In order to set the SGID on a directory or to remove it, use the following commands:

chmod g+s directoryname
chmod g-s directoryname

When set, the SGID attribute is represented by the letter "s" which replaces the "x" in the group permissions:

ls -l directoryname
drwxrwsr-x 10 george administrators 4096 2006-10-10 8:45 directory

No comments:

Post a Comment