November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

sgid

SGID attribute

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 rmohan administrators 4096 Jun 14 10:29 directory

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>