Sample Header Ad - 728x90

use setfacl to remove a users access to a directory?

0 votes
1 answer
73 views
So here is something I could not find any reference to, I have this user, user_A, I want to remove its access to this directory entirely /log/dirA As far as I understand, chmod is used to modify the access in this order user/group/others. Others is general and does not care who this is, just anyone other than the user, while not a member of group will be "other(s)", so I don't want to mess with other users access to this path, but I want to limit user_A from accessing it. Does **setfacl** work for directories too? because I used this command, which I think should deny read/write/execute access of the mentioned Directory to the user_A, but the user is still able to cd into the mentioned dir. Does setfacl apply only to files?? Command:
setfacl -Rdm u:user_A:--- /log/dirA
ls -lhtr of the mentioned path:
rwxr-xr-x+  3 Mainuser Mainuser   19 Apr 17  2018 dirA
getfacl /log/dirA :
# file: dirA/
# owner: Mainuser
# group: Mainuser
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:user_A:---
default:group::r-x
default:mask::r-x
default:other::r-x
Asked by Navid Taghavi (25 rep)
May 19, 2025, 08:45 AM
Last activity: May 19, 2025, 02:58 PM