0

I'm the local user on a system with admin rights. I would like to change the way the default owner and group permissions are set, when new files are created in the specified folder /var/www/html/somefolder

I can for example, run sudo chown -R leon:www-data somefolder, but if I create any new files in this folder, they are going to default to leon:leon.

Is there something I can do to the folder that will set any files or folder permissions created by me in /var/www/html/somefolder to be automatically set to leon:www-data?

Thanks.

user126440
  • 167
  • 1
  • 2
  • 9
  • 1
    You should be able to use `setgid` on the folder: see for example [Dynamically set user groups for directories and files on a directory](https://askubuntu.com/questions/608031/dynamically-set-user-groups-for-directories-and-files-on-a-directory) – steeldriver Dec 23 '19 at 13:28
  • From a learning point of view using the command `setfacl -d` would have been what I would have done but the `g+s` is shorter, so my question is there a difference between the two commands @steeldriver – George Udosen Dec 23 '19 at 13:34
  • @GeorgeUdosen I don't really know enough about ACLs to comment - sorry – steeldriver Dec 23 '19 at 13:40
  • Thanks, that's perfect. – user126440 Dec 23 '19 at 19:44

0 Answers0