setgid bit on directories
Set the setgid bit on directories to cause new files and dirs created inside of it to inherit its group ID, instead of the primary group ID of the user who created it.
Example:
# mkdir foo
# chgrp users foo
# touch foo/without_setgid
# ls -l foo/without_setgid
-rw-r--r-- 1 root root 0 Dec 12 14:24 foo/without_setgid
# chmod g+s foo
# touch foo/with_setgid
# ls -l foo/with_setgid
-rw-r--r-- 1 root users 0 Dec 12 14:24 foo/with_setgid
Written by Andy Walker
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#