XK0-005 · Question #786
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?
The correct answer is D. usermod -aG finance myuser. To add an existing user, 'myuser', to an existing supplementary group, 'finance', the administrator should use the usermod command with the appropriate options.
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
How the community answered
(24 responses)- A4% (1)
- B13% (3)
- C4% (1)
- D79% (19)
Why each option
To add an existing user, 'myuser', to an existing supplementary group, 'finance', the administrator should use the `usermod` command with the appropriate options.
`groupadd` is used to create a new group, not to add an existing user to an existing group.
`groupmcd` is not a standard Linux command for managing groups or users.
`useradd` is used to create a new user account, not to modify an existing one, and `-g` would set the primary group for a *new* user.
The `usermod -aG finance myuser` command is the correct way to add an existing user ('myuser') to an existing supplementary group ('finance'). The `-a` option ensures the user is appended to the group without removing them from other existing groups, and `-G` specifies the supplementary group(s) to add.
Concept tested: Adding user to supplementary group
Source: https://man7.org/linux/man-pages/man8/usermod.8.html
Topics
Community Discussion
No community discussion yet for this question.