nerdexam
CompTIACompTIA

XK0-005 · Question #786

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

The correct answer is D: usermod -aG finance myuser. To add an existing user, 'myuser', to an existing supplementary group, 'finance', the administrator should use the usermod command with the appropriate options.

System Management

Question

A systems administrator is reconfiguring existing user accounts in a Linux system. Which of the following commands should the administrator use to include "myuser" in the finance group?

Options

  • Agroupadd finance myuser
  • Bgroupmcd finance myuser
  • Cuseradd -g finance myuser
  • Dusermod -aG finance myuser

Explanation

To add an existing user, 'myuser', to an existing supplementary group, 'finance', the administrator should use the usermod command with the appropriate options.

Common mistakes.

  • A. groupadd is used to create a new group, not to add an existing user to an existing group.
  • B. groupmcd is not a standard Linux command for managing groups or users.
  • C. useradd is used to create a new user account, not to modify an existing one, and -g would set the primary group for a new user.

Concept tested. Adding user to supplementary group

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

Topics

#User and Group Management#Linux Commands#System Administration

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions