Interview Prep/Linux/Permissions, Users & sudo

Primary group vs supplementary groups?

IntermediateConceptPermissions, Users & sudo
Answer

Every user has one primary group (GID in /etc/passwd) used as the group for new files, and any number of supplementary groups that grant extra access.

id alice
sudo usermod -aG docker alice   # -a is critical: without it, other groups are removed
newgrp docker                   # pick up the new group in the current shell

Group changes apply to new login sessions only.

All Linux questions Roadmap: Linux

More on Permissions, Users & sudo