2

I have created a backup-user (let's just call it jeremy) on an Ubuntu-server.

Then I've created a backup-dir, containing files from several different servers:

/backup
   |
   |--server1
   |     |--daily_backup
   |     |--weekly_backup
   |
   |--server2
   |     |--daily_backup
   |     |--weekly_backup

I've then granted access to the backup-dir for jeremy with the following command:

setfacl -R -m u:jeremy:rwx backup/

However... If I login with the root-user and create a new directory, for instance: /backup/server2/monthly_backup, then jeremy won’t have access to the folder.

Is there a way to make it so that both root and jeremy can read, write and execute everything in the /backup-directory?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Zeth
  • 155
  • 6

1 Answers1

4

One must remember to create a default mask for all new filesystem objects as well.

setfacl -d -m u:jeremy:rwx backup/
Christopher
  • 15,611
  • 7
  • 51
  • 64
  • Awesome! I do need the `-R`-flag, in order for it to take effect on subfolders as well. So `setfacl -R -d -m u:jeremy:rwx backup/` did the job. – Zeth Mar 22 '18 at 14:56