nerdexam
CompTIACompTIA

XK0-005 · Question #1340

XK0-005 Question #1340: Real Exam Question with Answer & Explanation

The correct answer is B: ssermod -g apche buddy. To add an existing user to a group in Linux, the usermod command is used, often with specific flags to manage primary or supplementary group memberships.

System Management

Question

An administrator is adding an existing user named "buddy'' to the Apache group. Which of the following should the administrator perform to accomplish this task?

Options

  • Asseradd -g apache buddy
  • Bssermod -g apche buddy
  • Csudo useradd -g apache buddy
  • Dsudo usermod -g apachebuddy

Explanation

To add an existing user to a group in Linux, the usermod command is used, often with specific flags to manage primary or supplementary group memberships.

Common mistakes.

  • A. sseradd is not a standard Linux command, and useradd is used exclusively for creating new user accounts, not for modifying existing ones.
  • C. useradd is used to create new user accounts and cannot be used to modify the group memberships of an existing user.
  • D. While usermod is the correct command family, the group name apachebuddy appears to be a combined typo or misinterpretation, and usermod -g without -a changes the primary group, but the specific group name is problematic for the given task.

Concept tested. Linux user and group management - usermod

Reference. https://man7.org/linux/man-pages/man8/usermod.8.html

Topics

#Linux commands#User management#Group management#usermod

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions