nerdexam
CompTIA

XK0-004 · Question #371

An administrator wants to add a user named comptia to the system administrators group. Which of the following commands will accomplish this task?

The correct answer is B. Useradd -sG wheel comptia. The useradd command is used to create new user accounts on Linux systems. The -G flag specifies supplementary group membership at the time of account creation. The 'wheel' group is the standard system administrators group on Red Hat-based distributions (such as RHEL, CentOS…

System Management

Question

An administrator wants to add a user named comptia to the system administrators group. Which of the following commands will accomplish this task?

Options

  • AUsermod -sG wheel comptia
  • BUseradd -sG wheel comptia
  • Cvisudo -sG wheel comptia
  • Dsudo -sG wheel comptia

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    92% (22)
  • C
    4% (1)

Explanation

The useradd command is used to create new user accounts on Linux systems. The -G flag specifies supplementary group membership at the time of account creation. The 'wheel' group is the standard system administrators group on Red Hat-based distributions (such as RHEL, CentOS, and Fedora), and members of this group are typically granted sudo privileges. While the exam marks B as correct in the context of creating a new user and assigning them to the wheel group simultaneously, it is worth noting that in practice the correct syntax would be 'useradd -G wheel comptia' (without -s, which sets the login shell and requires a separate argument). Option A uses 'usermod', which modifies existing users rather than creating new ones, and also uses -sG incorrectly. Options C (visudo) and D (sudo) are not user management commands - visudo edits the sudoers file and sudo executes commands with elevated privileges.

Topics

#usermod#group management#wheel group#user administration

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice