I am trying to setup a directory /opt/www in such a way that when a user who belongs to the group django creates/modifies files and directorys within, they are set to owner django and group django.
I have looked at setuid and setgid confusion and Special File Permissions (setuid, setgid and Sticky Bit)
From this I chmod 6775 /opt/www However touch /opt/www/test yeilds
-rw-rw-r-- 1 wurst django 0 Mar 16 13:58 test
Q) How do I implement this requirement of having any user that belongs to group django, and creates a file or folder within /opt/www, to have it automaticaly chown django:django? (not :django)
Secondly, I am curious if this is nessisary for security purposes or if simply doing a chown -R :django and not worying about the owner beingt he user who created the file.
Note: in addition to creating the group django and adding my regular user account to this group, I have also created a system user via useradd -rg django django
Im oposed to storing my project within my home directory, although this will be on a live site, the site itself wont see much traffic as It will not be submiting it to search engines not premoted. Its sole purpose in life it as a learning platform for myself.
What might I be doing wrong? Do i need to write a custom script and schedule a cron job for it?