Interview Prep/Linux/Users, groups and access control

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 →

  1. Confirm: id alice (reads the database) vs id in their session (current process).
  2. Have them log out and back in, or run newgrp groupname for a subshell.
  3. 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.

All Linux questions Roadmap: Linux

More on Users, groups and access control