Search code examples
linuxpermissionsaclfolder-permissions

User cannot access folder after setting ACL permissions


I have several Users that are each added to their respective group. Only a user of that group can access the folder with the same name.

A problem arises when I want to give the User Stefan read permissions to the folder verkauf with setfacl. When I switch to that User he can not open the folder.

Do you know what the problem could be? Any tips to troubleshoot the issue are welcome.

Thanks in advance

[centos@iks-aufgabe ffhs]$ ls -l
total 40
drwxrwx---+ 2 root root 4096 Dec  9 16:29 firma
drwxrwx---+ 2 root root 4096 Dec  9 16:29 hr
drwxrwx---+ 5 root root 4096 Dec  9 16:29 projekt
drwxrwx---+ 2 root root 4096 Dec  9 16:29 technik
drwxrwxrwt. 2 root root 4096 Dec  9 16:29 temp
drwxr-x---. 2 root root 4096 Dec  9 16:29 verkauf

[centos@iks-aufgabe ffhs]$ getfacl verkauf
# file: verkauf
# owner: root
# group: root
user::rwx
group::r-x
other::---

[centos@iks-aufgabe ffhs]$ sudo setfacl -m user:Stefan:r,group:Verkauf:rwx 
verkauf
[centos@iks-aufgabe ffhs]$ getfacl verkauf
# file: verkauf
# owner: root
# group: root
user::rwx
user:Stefan:r--
group::r-x
group:Verkauf:rwx
mask::rwx
other::---

[centos@iks-aufgabe ffhs]$ su Stefan
Password:
[Stefan@iks-aufgabe ffhs]$ cd verkauf
bash: cd: verkauf: Permission denied
[Stefan@iks-aufgabe ffhs]$ id Stefan
uid=1003(Stefan) gid=1005(Firma) groups=1005(Firma),1003(HR)
[Stefan@iks-aufgabe ffhs]$

Solution

  • You need to add execution permissions to folders.

    sudo setfacl -m user:Stefan:rx,group:Verkauf:rwx