TestOut Linux Pro Practice Test 2025 – Complete Exam Prep Guide

Image Description

Question: 1 / 400

Which command adds a user to a secondary group?

usermod -G groupname username

The command that facilitates adding a user to a secondary group is indeed usermod -G groupname username. This command modifies the user's group memberships by assigning them to specified secondary groups. When using the -G flag, it is important to note that if this command is used without the --append option, it will replace all existing secondary group memberships with the ones specified, unless all desired groups are listed.

The context of the command also helps clarify its use: secondary groups are those that a user can belong to in addition to their primary group, facilitating various permissions and access controls on resources associated with these groups. For example, if a user needs access to specific files owned by a group, adding them to that group ensures they receive the appropriate permissions.

Other commands listed do not accomplish precisely what is asked. While some may manipulate user and group associations, they do not specifically add a user to a secondary group in the manner described by the question, making it clear why the correct command is the one identified.

Get further explanation with Examzify DeepDiveBeta

adduser username groupname

usermod --append -G groupname username

addgroup username groupname

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy