A system administrator needs to modify an existing user account named jsmith. The user's primary group must be changed to developers, and they must also be added to the testers supplementary group without losing their current supplementary group memberships. Which of the following commands will accomplish this?
The correct command is usermod -g developers -aG testers jsmith. The -g option correctly sets the new primary group to developers. The -G option is used to specify supplementary groups. The -a (append) option is critical here; when used with -G, it adds the user to the specified supplementary group (testers) without removing them from their existing ones. The other options are incorrect because they either misuse the flags or would produce an unintended result. usermod -G developers -g testers jsmith incorrectly swaps the primary and supplementary group flags. usermod -g developers -G testers jsmith would correctly change the primary group, but because it lacks the -a option, it would replace all of jsmith's current supplementary groups with only testers. useradd -g developers -aG testers jsmith uses the wrong utility; useradd is for creating new users, not modifying existing ones.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the -g option do in the usermod command?
Open an interactive chat with Bash
What role does the -aG option play when modifying a user’s supplementary groups?
Open an interactive chat with Bash
Why is usermod used instead of useradd when modifying accounts?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access