nerdexam
CompTIA

XK0-005 · Question #345

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?

The correct answer is B. ssermod -g apche buddy. This question tests the command used to add an existing user to a supplementary group on a Linux system.

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

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    96% (22)

Why each option

This question tests the command used to add an existing user to a supplementary group on a Linux system.

Asseradd -g apache buddy

useradd is used to create a new user account, not to modify an existing one.

Bssermod -g apche buddyCorrect

The usermod command is used to modify an existing user's account details, including their group memberships. While `-aG` is typically used to add a user to a supplementary group, `-g` can change the user's primary group, and usermod is the correct utility for modifying an existing user.

Csudo useradd -g apache buddy

useradd is used to create a new user account, not to modify an existing one.

Dsudo usermod -g apachebuddy

The command `sudo usermod -g apachebuddy` is missing the username as an argument and would attempt to set 'apachebuddy' as a primary group for an unspecified user.

Concept tested: Linux user and group modification

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

Topics

#User Management#Group Management#Linux Commands#usermod

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice