Group access often changes when a user joins a team, needs a shared project directory, or should use a service-owned resource without becoming that resource's owner. Adding the account to an existing supplementary group grants that extra access while leaving the user's primary group and default file ownership unchanged.
Linux resolves users and groups through the configured account databases, so getent checks the same lookup path that many local tools and services use. The usermod command updates local account records, and --append with --groups adds a supplementary membership without replacing the rest of the user's group list.
The user and group should already exist on the local system before changing membership. Create the group first when the target group is missing, and update the identity provider instead when the account is managed by LDAP, Active Directory, or another central directory. Existing shells and long-running services keep their old group credentials until the user signs in again or the affected service restarts.
Related: How to create a user in Linux
Related: How to create a group in Linux
Related: How to remove a user from a group in Linux
$ getent passwd audituser audituser:x:1001:1001:Audit User:/home/audituser:/bin/bash
Replace audituser with the login that needs the extra group membership.
$ getent group finance finance:x:1002:
The group must exist before usermod can add the user to it.
$ sudo usermod --append --groups finance audituser
Do not omit --append when using --groups for this task. Without it, usermod replaces the supplementary group list with only the groups named in the command.
$ id audituser uid=1001(audituser) gid=1001(audituser) groups=1001(audituser),1002(finance)
$ groups audituser audituser : audituser finance
$ sudo -iu audituser id -nG audituser finance
If the user already has an open desktop, terminal, SSH session, or service process, reopen that session or restart the service before testing access that depends on the new group.