I have structure like:
/home/reed/, user=reed, group=reed - apache-conf, user=reed, group=reed - apache-web, user=reed, group=apache, perm=0770 - www.website.com, user=reed, group=apache, perm=0770 - index.php, user=reed, group=apache, perm=0660
umask 007 in
/etc/profile so my directories & files are created with these same permissions. & that worked.
chmod g+s /home/reed/apache-web; and
chmod g+s /home/reed/apache-web/www.website.com so new directories will keep the
mkdir /home/reed/apache-web/test/, then
ls -la ... & it shows
reed is both the user & the group.
I tried using
chmod 4770 /home/reed/apache-web/test/, but
mkdir still sets both user & group to
root if I'm running with sudo)
I tried it in the
www.website.com dir as well with the same results.
I'm on Debian 10 with root access available. I also tried switching to user=apache & group=reed, then using
chmod u+s thedir, but again,
mkdir makes both the user & the group the current shell user. I also tried logging out & logging back in