A developer reports that their newly added group membership is not working even though `id alice` shows it. What do you explain and do?
BeginnerScenarioUsers, groups and access control
Answer
Situation read → Group lists are loaded at login, so existing sessions don't see the change.
What I'd do →
- Confirm:
id alice(reads the database) vsidin their session (current process). - Have them log out and back in, or run
newgrp groupnamefor a subshell. - For services running as that user, restart the service.
Why → The kernel stores supplementary groups in the process credentials when the session starts.
Interview tip → This is also why systemctl restart is needed after adding a service user to a group.
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