Setting permissions based on directory independent of owner

Anyone know how to set one set of default file permission on one file/directroy and another set of permissions on another ?

Set A might be:
 - read/write owner, everyone else read

Set B might be:
 - read/write developers, everyone else read

So that if any file/directory is created it will take on the permission of the section rather than the default permissions of the user. This is at the filesystem level and not exposed through Samba or any other mechanism.

Example: A web server is running on a debian box. Developers have local changes in their home directory which they wish to copy to the site served by the web server. When in their own home directory, a developer's files have "Set A" permissions. When a file is copied to the web directory, its permissions should change to those of "Set B".

Ideally this should require no manual altering of permissions, and should be taken care of by the filesystem to reduce the chance of human error by as much as possible. Is there a way to achieve this?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

No, there is no way to do this.

The only control the directory has on the files is the group-ownership (sgid on the directory will set newly created files to the same group as the directory).

This is because files can live in more than one directory in Unix, unlike just about any other OS.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nwranghamAuthor Commented:

I was worried that would be the case

Thanks for your help
Not entirely true.
Newer kernel has the feature called inotify, where You can plug Your own actions to be taken upon file change/creation.
Could be that, but I never use it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.