0

I've recently learned about an amazing usage of chmod: chmod g+s /path/to/dir which makes every new file in that directory be put into the group that the directory itself is owned by.

Is there a way to have this behaviour, but for user? That is, if a public_html folder was owned by user/group "someuser", setting g+s on the folder means new files created as root are owned by user "root" and group "someuser". What I'd like to set up is new files created by root are owned by user "someuser" and group "someuser".

It looks like chmod u+s should do this, except that appears to only modify who can execute executable files. :/

0

1 Answer 1

0

No, you cannot do anything like this. 

Except, perhaps, by creating and mounting a filesystem that does not support file ownership (e.g., FAT?); then all the files on that entire filesystem will appear to be owned by the same user.

Not the answer you're looking for? Browse other questions tagged .