When I create new files and folders in a specific folder, I would like them to inherit the group and permissions of the parent folder. Is this possible ?
For example
mkdir -p example.com/public
cd example.com
sudo chgrp apache public
chmod 775 public
Now when I create a new folder
cd public
mkdir test
ls -al
drwxrwxr-x 3 foo bar 4096 Nov 3 16:19 public
The test
directory belongs to foo
and my default group bar
. I'd like new folder to belong to the apache
group instead.
I'd like the same behavior for files.
Any ideas?