0
I wrote a script that creates some users (5 in this case) called 1 to 5, creates their home directories, and gives full access to those directories only to those five users. Here is the script:
MIN=1
MAX=5
for (( USER=$MIN; USER<=$MAX; USER++ )); do
useradd -m $USER
HOMEDIR=/home/$USER
setfacl -m o:--- $HOMEDIR
for (( other=$MIN; other<=$MAX; other++ )); do
setfacl -m u:$other:x $HOMEDIR
done
done
This script is executed as a root, and after that I do
su - 1
cd /home/2
And the result is
bash: cd: 2: Permission denied
I executed this script on Ubuntu 17.04 and Debian 8.9 with ACL turned on by default, and on both platforms I get the same result. What could be the problem?
Care to update your question with the output of
getfacl /home/2
Otherwise your question is missing a crucial information. – kostix – 2017-10-10T17:25:08.683Also note that granting
x
w/o also grantingr
is possible but almost useless:x
allowscd
-ing into the directory and searching in and through it, but onlyr
actually allows reading the directory contents. Hence with onlyx
allowed, you could not even dols
. – kostix – 2017-10-10T17:26:42.120