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.
More on Users, groups and access control
You need to onboard 50 new developers onto a shared build server, each with their own account and SSH key. How do you do it?BeginnerThree teams share one server and each needs a project directory only its members can write to, with new files staying group-owned. How do you set it up?BeginnerA junior engineer needs to restart nginx but must not get full root. How do you grant that?BeginnerAn engineer leaves the company today. What do you do with their Linux account on 30 servers?BeginnerA service account for a backup tool must exist on every server but nobody should be able to log in as it. How do you create it?BeginnerYour security team requires passwords to expire every 90 days for human users only. How do you implement it?Beginner