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.
sseraddis not a standard Linux command, anduseraddis used exclusively for creating new user accounts, not for modifying existing ones. - C.
useraddis used to create new user accounts and cannot be used to modify the group memberships of an existing user. - D. While
usermodis the correct command family, the group nameapachebuddyappears to be a combined typo or misinterpretation, andusermod -gwithout-achanges 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.