Lpic 1 Linux Administrator · Free Practice Question Medium
Question 17
- A The -G option in usermod command only allows a user to be part of one secondary group at a time.
- B The groupmod command should be used instead of usermod to modify user group memberships.
- C The -a option must be used with -G in the usermod command to append a group to the existing list of secondary groups.
- D john is the primary group of another user and can only be added using the -g option.
Reveal correct answer
Correct answer: C
A. The -G option in the usermod command actually allows a user to be part of multiple secondary groups at the same time. Therefore, the issue is not related to the limitation of the -G option.
B. While the groupmod command can be used to modify group properties, the usermod command is the correct tool for modifying user group memberships. The issue is not related to using the wrong command.
C. The reason for the issue is that the -a option must be used with the -G option in the usermod command to append a group to the existing list of secondary groups. Without the -a option, the existing secondary groups are replaced with the new group specified.
D. The issue is not related to the primary group of another user. The -g option in the usermod command is used to specify the primary group of a user, not to add a user to a secondary group.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
