RHCSA - Part9 - ACLs
Use chown to change ownership:
# chown alice: /home/alice/testdir
Use getfacl to retrieve the ACLs:
# getfacl /home/alice/testdir
Use setfacl with -m option to set standard and default ACLs for ben to access testdir subfolder with read-only permissions:
# setfacl -m u:ben:rx /home/alice
# setfacl -m du:ben:rx /home/alice
Use setfacl with option -m to modify standard and default ACLs in order to provide ben with read and write access:
# setfacl -m u:ben:rwx /home/alice/testdir
# setfacl -m du:ben:rwx /home/alice/testdir
Check newly applied ACLs on folders /home/alice and /home/alice/testdir:
# getfacl /home/alice
# getfacl /home/alice/testdir
Real-life test to check new access rights:
# su - ben
$ touch /home/alice/testdir/testfile
$ echo "this is a write access test" > /home/alice/testdir/testfile
$ cat /home/alice/testdir/testfile
this is a write access test