Add Users to a Secondary Group — Linux account administration

SY0-701 · 4.6.1

workstation — bash

Your assignment

You administer the Linux jump host for Brightline Analytics. Two analysts just joined the data team — Priya Venkat (pvenkat) and Theo Marsh (tmarsh). Their accounts already exist. To grant them access to shared analytics resources, add the existing analysts group to each account as a secondary group — without disturbing the secondary groups they already hold (staff and vpn respectively).
  • Add analysts as a secondary group for pvenkat, keeping existing groups. Existing secondary group staff must be preserved.
  • Add analysts as a secondary group for tmarsh, keeping existing groups. Existing secondary group vpn must be preserved.
  • Verify your work. Run groups or cat /etc/group after both accounts are updated.

Useful commands: usermod, gpasswd, groups, id, cat /etc/group, help, reset, clear.

Knowledge check

1. You must add an account to one more (secondary) group while leaving its current memberships untouched. Which usermod option set does that?
2. Which usermod option changes a user's primary (login) group rather than a secondary one?
3. After updating memberships, which command quickly lists every group a single user belongs to?
Score: 0 / 6