CompTIA
XK0-006 · Question #42
A Linux administrator wants to add a user to the Docker group without changing their primary group. Which of the following commands should the administrator use to complete this task?
The correct answer is C. sudo usermod -aG docker user. The usermod -aG command appends (-a) the user to a supplementary group (-G) without changing their primary group. This is the correct way to add a user to the docker group.
Services and User Management
Question
A Linux administrator wants to add a user to the Docker group without changing their primary group. Which of the following commands should the administrator use to complete this task?
Options
- Asudo groupmod docker user
- Bsudo usermod -g docker user
- Csudo usermod -aG docker user
- Dsudo groupmod -G docker user
How the community answered
(24 responses)- A4% (1)
- C92% (22)
- D4% (1)
Explanation
The usermod -aG command appends (-a) the user to a supplementary group (-G) without changing their primary group. This is the correct way to add a user to the docker group.
Topics
#usermod#group management#Docker#user administration
Community Discussion
No community discussion yet for this question.