1

I have a directory tree (in a Linux system) at "/opt/cudasamples" owned by root.
I wish to be able to change contents (files and subdirectories) of this directory as a normal user, i.e. without sudo'ing.
How can I add ACL settings to the directory and its contents to give my regular user account the same access privileges as root?
So, I am not looking to slacken the ordinary permissions on the tree to allow everyone to write. Rather, I am looking to give a specific user the same permissions as root in the tree.

0

1 Answer 1

2

To give a user account full permissions on a folder, use

setfacl -m useraccount:rwx folder

Use the -R parameter for recursive.

For more information, see setfacl.

2
  • Does that set the execute bit "x" on all contained files as well as directories? I wouldn't want that for most of the files. Ideally I would like to set the permissions to the same as the owner's (root's), whatever they are. Commented Aug 12, 2021 at 7:24
  • 1
    From man setfacl: "execute only if the file is a directory or already has execute permission for some user (X)".
    – harrymc
    Commented Aug 12, 2021 at 8:12

You must log in to answer this question.

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