Courseiva

LFCS User and Group Management Practice Question

A junior administrator needs to add user 'mchen' to the supplementary group 'developers' without removing existing group memberships. Which command should be used?

⚠ Common exam trap

The trap here is forgetting the -a flag, which leads to replacing all supplementary groups instead of appending.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

usermod -aG developers mchen

To add a user to a supplementary group while preserving existing memberships, use usermod with the -a (append) and -G (supplementary groups) options. Without -a, the -G option replaces all supplementary groups. This command safely adds the new group without affecting others, ensuring the user retains all necessary access.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    usermod -aG developers mchen

    Why this is correct

    The -aG option appends the specified group to the user's supplementary group list. Without -a, usermod -G would replace all existing supplementary groups. This command preserves current memberships and adds 'developers', which is exactly what is needed.

  • ✗

    usermod -G developers mchen

    Why it's wrong here

    This command sets the user's supplementary groups to only 'developers', removing any other supplementary groups. It does not append, so existing memberships are lost. This could revoke access to other resources and is not the correct approach when preserving existing groups is required.

  • ✗

    groupmod -a -U mchen developers

    Why it's wrong here

    groupmod is used to modify group properties, not to add users to groups. The -U option is not standard for groupmod; it is used with gpasswd to add users. This command is invalid and will not achieve the desired result, potentially causing confusion or errors.

  • ✗

    gpasswd -a mchen developers

    Why it's wrong here

    gpasswd -a adds a user to a group, but it is typically used for group administration and may not be available or preferred in all contexts. While it does add the user, the canonical command for modifying a user's group membership is usermod -aG. The question asks for the command to use, and usermod is the standard tool.

About these practice questions

This LFCS question is part of Courseiva's 406-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint

This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.