0

How can I allow a specific user on my Ubuntu desktop to view/open all folders and files in a specific location without affecting or changing the owner:group of that location?

Until now I need to legitimate me and I don't want this behavior. The location is a backup directory from rsync who need to preserve the owner:group.

Thanks in advance.

1 Answer 1

0

You can use ACLs. If you want in addition to existing owner:group permissions add a permission for user1 to browse folder folder1 and it's contents, use the command:

setfacl -m -R u:user1:rX folder1
6
  • If the content change is needed to run this command after all content change because it's recursive? And how to remove this permission if needed?
    – Omexlu
    Feb 9, 2021 at 3:36
  • The command is recursive because you wanted to add access for all files and subfolders in folder1. If the content changes, you can run the command only for new files/folders (this time without the -R parameter), or rerun for the whole folder again. To remove the permission, use -x instead of -m. See man setfacl for more details.
    – raj
    Feb 9, 2021 at 10:09
  • Thanks you, I rerun the command after all rsync backup trough my bashscript works fine :)
    – Omexlu
    Feb 9, 2021 at 12:41
  • Before synchronisation from local-PC to server It might be better to remove setfacl completely from local-PC because it changes the files right, the extanted rights (+) are removed but the file rights are still with rX, so it might better to remove before syncing back to server?
    – Omexlu
    Feb 10, 2021 at 7:46
  • Possibly yes, I never used it in that scenario, so you have to try.
    – raj
    Feb 10, 2021 at 9:58

You must log in to answer this question.

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