# How to inherit or set specific permissions for all folders and files created or moved to a specific folder even by root



## supportsobaka (Sep 22, 2018)

Is there a way to inherit *or automatically set* specific permissions of unprivileged user for any folders and files created under or moved to a specific path (i.e. folder) even if these newly created or copied folders/files was created/copied by root  with root's permissions in shell before?

Provided:
/home/unprivdir with permissions unprivuser:unprivuser

Test:
#whoami
root

#cd /root
#touch somefile
#chmod 750 somefile
#chown root:wheel somefile
#cp file /home/unprivdir/

Now I want to see that "somefile" will have unprivuser:unprivuser and chmod 750

Is that possible to achieve by native permissions/ACL system without external monitoring daemons or cron?  Setuid seems useless. If not possible, do you know any monitoring daemons that will provide such functionality realtime?


----------

