Differences
This shows you the differences between two versions of the page.
linux_wiki:create_and_configure_set-gid_directories_for_collaboration [2016/03/03 22:13] billdozor |
linux_wiki:create_and_configure_set-gid_directories_for_collaboration [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Create And Configure Set-gid Directories For Collaboration ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Team collaboration directories. | ||
- | |||
- | ---- | ||
- | |||
- | ===== Scenario ===== | ||
- | |||
- | When files are created in a directory with set-GID, the new files inherit the group ownership of that directory. | ||
- | |||
- | **Example scenario**: The IT department would like to have a directory for its shared scripts amongst team members in /home/. They want the directory called " | ||
- | |||
- | ---- | ||
- | |||
- | ===== Solution ===== | ||
- | |||
- | Create the group " | ||
- | <code bash> | ||
- | groupadd it | ||
- | </ | ||
- | |||
- | \\ | ||
- | Create rjones and dvader | ||
- | <code bash> | ||
- | useradd rjones | ||
- | useradd dvader | ||
- | </ | ||
- | |||
- | \\ | ||
- | Add the " | ||
- | <code bash> | ||
- | usermod -aG it rjones | ||
- | usermod -aG it dvader | ||
- | </ | ||
- | |||
- | \\ | ||
- | Create the " | ||
- | <code bash> | ||
- | mkdir / | ||
- | </ | ||
- | |||
- | \\ | ||
- | Change ownership | ||
- | <code bash> | ||
- | chown root:it / | ||
- | </ | ||
- | |||
- | \\ | ||
- | Change the group set-GID bit so all files created will be owned by " | ||
- | <code bash> | ||
- | chmod g+s / | ||
- | chmod g+w / | ||
- | </ | ||
- | * Also give them write access | ||
- | |||
- | \\ | ||
- | Remove Permissions from all others | ||
- | <code bash> | ||
- | chmod o-rwx / | ||
- | </ | ||
- | |||
- | ---- | ||