Shared server guidance · Question & answer

How do I add a Linux user to one group without removing their other groups?

Use usermod with both -a and -G when appending a supplementary group. Omitting -a can replace the existing supplementary group list. Group membership is a security decision: some groups, including container-management or disk-access groups, may provide extensive host privileges.

IntermediateLinux VPS and dedicated servers with GNU utilities
Go to the answer

Before you start

  • An authorised SSH session on the Linux server.

Instructions

1. Inspect the account and target group

Replace appreaders with the already-approved group. Check what access that group grants before adding anyone to it.

Remote Linux shell
id adminuser
getent group appreaders

Record the existing memberships and confirm that appreaders is the intended existing group.

2. Append and test a fresh session

Apply the one-group change with administrative authorisation. Existing processes retain their previous group list, so a new login is the normal verification path.

Remote Linux shell
sudo usermod -aG appreaders adminuser
id adminuser

-a appends rather than replacing other supplementary memberships. The named lookup reflects the account database after the change.

Check the result

  • A fresh SSH session shows appreaders in id, retains the previous groups and can perform the specifically approved task.

Troubleshooting

The new group is listed but access still fails
Inspect the target file’s group and directory traversal. Membership alone does not override ACLs, security labels or application authorisation.
The group does not exist
Confirm the access design before creating a new group; an invented group name will not grant useful access.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.