Using ACLs to access files in the shared directory
As things currently stand, all members of the marketing
group have read/write access to all other group members’ files. Restricting access to a file to only specific group members is the same two-step process that we’ve already covered.
Setting the permissions and creating the ACL
First, Vicky sets the normal permissions to only allow herself to have read/write permissions on the file. Then, she’ll create an ACL that will allow Cleopatra to read the file:
[vicky@localhost marketing]$ echo "This file is only for my good friend, Cleopatra." > vicky_file.txt
[vicky@localhost marketing]$ chmod 600 vicky_file.txt
[vicky@localhost marketing]$ setfacl -m u:cleopatra:r vicky_file.txt
[vicky@localhost marketing]$ ls -l
total 4
-rw-rw-r--. 1 charlie marketing 0 Nov 13 15:59 charlie_file.txt
-rw-r-----+ 1 vicky marketing 49 Nov 13 16:24 vicky_file.txt
[vicky@localhost marketing]$ getfacl vicky_file...