I have a directory set up on a Linux server such that I'd like all files within it to be readable and writeable for a specific group.

So far, I've done chmod g+s mygroup parent, and I can see that all files inherit this group when created within this directory.

However, it does not force the g+rw permission, and so it is possible for a user to write a file into that directory such that others do not have read and/or write access to it.

How can I achieve this?

  • What is mygroup? Because of its name I expect a group but the syntax of chmod g+s mygroup parent doesn't fit. This obfuscates the question slightly. – Kamil Maciorowski Oct 21 '18 at 5:25

Turns out the answer is to use ACLs to set a default:

setfacl -d -m u::rwX,g::rwX,o::- /path/to/parent

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.