LX0-104 · 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 existing user accounts, including the ability to remove a user from supplementary groups.
Question
Options
- Agrouprm
- Bgroupmod
- Cpasswd
- Dusergroups
- Eusermod
How the community answered
(40 responses)- A5% (2)
- B3% (1)
- D3% (1)
- E90% (36)
Why each option
The usermod command is used to modify existing user accounts, including the ability to remove a user from supplementary groups.
grouprm is not a standard Linux command for group management; groupdel is used to delete a group.
groupmod is used to modify group properties (like name or GID), not user memberships within groups.
passwd is used to change a user's password and related account expiration details, not group memberships.
usergroups is not a standard Linux command; groups lists a user's groups.
The usermod command is specifically designed for modifying user account properties. To remove a user from a supplementary group, you can use usermod -G new_group_list username, providing a comma-separated list of groups the user should remain in, effectively removing them from any groups not listed. Alternatively, some systems support usermod --remove-group groupname username.
Concept tested: Managing user group memberships
Source: https://linux.die.net/man/8/usermod
Topics
Community Discussion
No community discussion yet for this question.