I'm looking to have all files in a directory owned by bob. I'm aware I can chmod g+s to get the group set on new files but I don't think I can do anything like that for the user.
This is what I've come up with.. or is there another way to do this ?
[root@testmachine ~]# mkdir /testing.d
[root@testmachine ~]# setfacl -m default:u:bob:rwx,default:g:testgroup:rwx /testing.d/
[root@testmachine ~]# touch /testing.d/someone
[root@testmachine ~]# getfacl /testing.d/someone
getfacl: Removing leading '/' from absolute path names
# file: testing.d/someone
# owner: root
# group: root
user::rw-
user:bob:rwx #effective:rw-
group::r-x #effective:r--
group:testgroup:rwx #effective:rw-
mask::rw-
other::r--
[root@testmachine ~]# getfacl /testing.d/
getfacl: Removing leading '/' from absolute path names
# file: testing.d/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:bob:rwx
default:group::r-x
default:group:testgroup:rwx
default:mask::rwx
default:other::r-x
[root@testmachine ~]#
Thanks
chmod u+s your_directory
This command will force the ownership of new subdirectories and files to be the owner of the containing directory – AReddy Feb 11 '16 at 05:28