We have group Apache and, let's say, "District" group.
All our team members are part of "District" group.
Apache user is part of "Apache" group, and does a lot of work on our server, creating and modifying files. But "Apache" group has fairly strict permissions, so there is no way we "District" group members can write to these files.
How can we help "District" members have write permissions to these files? One way to solve it is to "chmod 777" everything in the Apache group...but...eh. We don't want the anyone to be able to edit these files...just people from "District" group.
Question: Is it possible to make "Apache" user remain in "Apache" group, but write as part of "District" group? (and, therefore, have all Apache-authored files become accessible to "District" members)
setgid
bit on a directory - it forces all new files/subdirs created to be owned by the group that you did thesetgid
with on the upper level directory.