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.
Add a comment
|
1 Answer
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.
-
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
-
1From
man setfacl
: "execute only if the file is a directory or already has execute permission for some user (X)".– harrymcCommented Aug 12, 2021 at 8:12