LFCS · Question #114
Which of the following commands can remove a user from a group?
The correct answer is E. usermod. The usermod command is used to modify a user's account attributes, including removing them from groups.
Question
Options
- Agrouprm
- Bgroupmod
- Cpasswd
- Dusergroups
- Eusermod
How the community answered
(34 responses)- A6% (2)
- B3% (1)
- D3% (1)
- E88% (30)
Why each option
The `usermod` command is used to modify a user's account attributes, including removing them from groups.
`grouprm` is not a standard Linux command; `groupdel` is used to delete a group, not remove a user from a group.
`groupmod` is used to modify a group's properties (like its name or GID), not to manage user memberships within it.
`passwd` is exclusively used for changing a user's password and has no functionality for managing group memberships.
`usergroups` is not a standard Linux command for user or group management.
The `usermod` command allows administrators to modify various user account properties, including supplementary group memberships. By specifying a new list of supplementary groups using the `-G` option without `-a`, a user can effectively be removed from any groups not included in the new list.
Concept tested: User group management (`usermod`)
Source: https://man7.org/linux/man-pages/man8/usermod.8.html
Topics
Community Discussion
No community discussion yet for this question.