I want to set a folder such that anything created within it (directories, files) inherit default permissions and group.
Lets call the group "media". And also, the folders/files created within the directory should have g+rw automatically.
I found it: Applying default permissions
From the article:
Set the setgid
bit, so that files/folder under <directory> will be created with the same group as <directory>
chmod g+s <directory>
Set the default ACLs for the group and other
setfacl -d -m g::rwx /<directory>
setfacl -d -m o::rx /<directory>
Next we can verify:
getfacl /<directory>
Output:
# file: ../<directory>/
# owner: <user>
# group: media
# flags: -s-
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments