nerdexam
CompTIA

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.

Administrative Tasks

Question

Which of the following commands can remove a user from a group?

Options

  • Agrouprm
  • Bgroupmod
  • Cpasswd
  • Dusergroups
  • Eusermod

How the community answered

(40 responses)
  • A
    5% (2)
  • B
    3% (1)
  • D
    3% (1)
  • E
    90% (36)

Why each option

The usermod command is used to modify existing user accounts, including the ability to remove a user from supplementary groups.

Agrouprm

grouprm is not a standard Linux command for group management; groupdel is used to delete a group.

Bgroupmod

groupmod is used to modify group properties (like name or GID), not user memberships within groups.

Cpasswd

passwd is used to change a user's password and related account expiration details, not group memberships.

Dusergroups

usergroups is not a standard Linux command; groups lists a user's groups.

EusermodCorrect

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

#user management#group management#usermod

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice