0

I was trying to access a file on another users home directory using acl. I have tried to do it the following way.

User k9 made a file test.file and ran

setfacl -m u:sai:rwx test.file.

Following is the getfacl output.

k9@xxxx:~$ getfacl test.file
# file: test.file
# owner: k9
# group: k9
user::rw-
user:sai:rwx
group::rw-
mask::rwx
other::r--

And from user sai I tried accessing this file

sai@xxxx:~$ ls /home/k9/
ls: cannot open directory '/home/k9/': Permission denied
sai@xxxx:~$ ls /home/k9/test.file
ls: cannot access '/home/k9/test.file': Permission denied

Can we use setfacl to access test.file without having complete access to /home/k9/ ? If so what am I doing wrong and if not how can that be done?

4
  • 1
    Welcome to the site. What does getfacl /home/k9/ reveal when run as user k9?
    – AdminBee
    Commented Oct 21, 2022 at 10:20
  • sai@xxxx:~$ getfacl /home/k9/ getfacl: Removing leading '/' from absolute path names # file: home/k9/ # owner: k9 # group: k9 user::rwx group::r-x other::--- @AdminBee
    – gst1502
    Commented Oct 21, 2022 at 10:22
  • 1
    The problem is: If you don't have "execute" rights on a directory, you cannot access any files within it, simply because you can't "enter" it.
    – AdminBee
    Commented Oct 21, 2022 at 10:32
  • @AdminBee is there a way to have some other way to do this then? Access just a specific file in another directory? Also what exactly does giving execute rights to the directory do?
    – gst1502
    Commented Oct 21, 2022 at 10:36

1 Answer 1

0

you do not have permissions on directories, apply ACL on them as well

1
  • If I do that will I not have access to all files inside the directories? I only want permissions to the single file test.file @csx4
    – gst1502
    Commented Oct 21, 2022 at 10:23

You must log in to answer this question.

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