0

I have a directory with lots of subdirectories. For reasons, I can't change the owner or group of this directory or it's subdirectories.

I need to have a user that can access some of the subdirectories but not all. What is the best way to achieve this?

1

yeah, ACLs will be your best bet:

[root@server ~]# setfacl -m d:u:usr1:rw tmpdir1
[root@server ~]# setfacl -m u:usr1:rw tmpdir1
[root@server ~]# getfacl tmpdir1/
# file: tmpdir1/
# owner: root
# group: root
user::rwx
user:usr1:r-x                <--
group::r-x
mask::r-x
other::r-x
default:user::rwx
default:user:usr1:r-x        <--
default:group::r-x
default:mask::r-x
default:other::r-x

Setting the Default option on a folder means that the user will create future files in that directory with these permissions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.