When 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 will be set to the user's default group.
To set the SGID on a directory or to remove it, use the following commands:
chmod g+s directory
chmod g-s directory
When set, the SGID attribute is represented by the letter "s" which replaces the "x" in the group permissions:
ls -l public
drwxrwsr-x 10 brett users 4096 2009-012-10 17:40 public