At times, I come across cases where I need to give access to a group/user to a particular file/directory. This can be done using ACL (Access Control List). Below is how its done 🙂
setfacl -Rdm u:test_user:rwx /opt/app
Gives RWX access to test_user to /opt/app directory & all its sub-directories.
setfacl -b /opt/app
Removes ACL entries from /opt/app directory.
setfacl -x u:test_user /opt/app
Revokes the rights given to test_user to /opt/app directory.