0
I have several users in several different groups. So...
sudo su
>$ ls -l /home/
drwxr-x--- 5 root group1 4096 Mar 18 12:44 group1
drwxr-x--- 6 root group2 4096 Feb 9 13:58 group2
>$ ls -l /home/group1
drwx------ 6 user1 group1 4096 Mar 23 15:57 user1
drwx------ 6 user2 group1 4096 Mar 23 12:19 user2
Now user3 is a member of group2. I want user3 to be able to read and execute user1's home directory but I don't want to permit user2 (who is in the same group as user1) to have any permissions to user1's home directory.
If I try using acl's.
>$ getfacl /home/group1/user1
# file: user1/
# owner: user1
# group: group1
user::rwx
group::---
other::---
>$ setfacl -m u:user3:rx /home/group1/user1/
>$ getfacl /home/group1/user1
# file: user1/
# owner: user1
# group: group1
user::rwx
user:user3:r-x
group::---
mask::r-x
other::---
>$ ls -l /home/group1
drwxr-x---+ 11 user1 group1 4096 Mar 22 14:57 user1
drwx------ 6 user2 group1 4096 Mar 23 12:19 user2
Since I changed the acl's, the group permissions of user1's home directory also changed. Now user2 can read and execute in user1's home directory. The man page for setfacl is a bit sparse.
QUESTION : is there a way to give user3 (who's in group2) permission to user1's home directory without automatically giving user2 permission?
I would like to use acl's for this.
Did you tried to create a new
group_N
Create a new userUserNew
. Do memberUserNew
user1
anduser3
of thegroup_N
. Change the ownership of the home of user1 toUserNew
andgroup_N
. Allo._w read write execute to user and group? It should work but I did not suggest you to do for the home. Better to try in a subdir of the home. – Hastur – 2016-03-24T06:09:51.550