CompTIACompTIA
XK0-005 · Question #1366
XK0-005 Question #1366: Real Exam Question with Answer & Explanation
The correct answer is B: Useradd -sG wheel comptia. To add a new user named comptia and assign them to the wheel (system administrators) group, the useradd command is used, specifying the desired groups during creation.
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
Explanation
To add a new user named comptia and assign them to the wheel (system administrators) group, the useradd command is used, specifying the desired groups during creation.
Common mistakes.
- A. The
usermodcommand is used to modify an existing user account, not to create a new one. Additionally, the-soption is for setting the login shell, not for group assignment in this context. - C. The
visudocommand is used to safely edit the/etc/sudoersfile to configuresudoprivileges, but it does not add users to groups directly. - D. The
sudocommand is used to execute a command as another user (typically root) and is not used for managing user accounts or groups.
Concept tested. User and group management with useradd
Reference. https://www.redhat.com/sysadmin/linux-user-management
Topics
#User management#Group management#Linux commands#System administration
Community Discussion
No community discussion yet for this question.