CompTIACompTIA
XK0-005 · Question #1781
XK0-005 Question #1781: Real Exam Question with Answer & Explanation
The correct answer is D: usermod -aG finance myuser. To add an existing user to a supplementary group in Linux, the usermod command with the appropriate options for appending to supplementary groups is used.
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 to a supplementary group in Linux, the usermod command with the appropriate options for appending to supplementary groups is used.
Common mistakes.
- A. The
groupaddcommand is used to create a new group, not to add a user to an existing group. - B.
groupmcdis not a standard Linux command for user or group management. - C. The
useradd -g finance myusercommand is used to create a new user and set their primary group tofinance, not to add an existing user to a supplementary group.
Concept tested. Adding user to supplementary group
Reference. https://man7.org/linux/man-pages/man8/usermod.8.html
Topics
#User Management#Group Management#Linux Commands#System Administration
Community Discussion
No community discussion yet for this question.