Interview Prep/Linux/Users, groups and access control

Two developers need read access to `/var/log/app/` without being added to the `adm` or root group. How?

IntermediateScenarioUsers, groups and access control
Answer

Situation read → Fine-grained access beyond owner/group/other: use ACLs.

What I'd do →

sudo setfacl -R -m u:alice:rX,u:bob:rX /var/log/app
sudo setfacl -d -m u:alice:rX,u:bob:rX /var/log/app   # default ACL for new files
getfacl /var/log/app

Check that logrotate does not recreate files with modes that drop the ACL mask (create 0640 keeps the mask usable).

Why → ACLs grant per-user rights without changing the file's owner or group, and default ACLs apply to files created later.

Interview tip → Mention the + in ls -l output as the sign that an ACL exists.

All Linux questions Roadmap: Linux

More on Users, groups and access control