usermod -aG appends an existing user to a supplementary group without touching their other group memberships.
sudo usermod -aG <group-name> <username>The -a (append) flag is critical: omit it and -G replaces the user’s entire supplementary group list with the one given, dropping every other group they belonged to.
Group membership only refreshes on the next login (or new shell session) — an already-open shell keeps the old id output. Force a refresh in the current shell without logging out:
newgrp <group-name>Verify membership:
groups <username>
id <username>Cheatsheet
Add user to a group
sudo usermod -aG <group-name> <username>Add user to multiple groups at once
sudo usermod -aG <group-one>,<group-two> <username>Verify
id <username>Apply new group in current shell
newgrp <group-name>