nerdexam
CompTIA

XK0-005 · Question #379

A Linux administrator is adding a user's local Linux account to the accounting group. The user is also a member of the finance group. Which of the following is the BEST way to add the user to the…

The correct answer is D. Usermod -aG accounting user1. Assigning secondary groups to users Use usermod command to make existing user a member of an existing group. Use -aG switch to add a new group. In this example, we make user username a member of group groupname. Note that group groupname has to be already created. > usermod -aG…

System Management

Question

A Linux administrator is adding a user's local Linux account to the accounting group. The user is also a member of the finance group. Which of the following is the BEST way to add the user to the accounting group while still maintaining the user's existing group members ships?

Options

  • AUsermod -g accounting user1
  • BUsermod -G accounting, finance user1
  • CUsermod -G accounting user1
  • DUsermod -aG accounting user1

How the community answered

(40 responses)
  • A
    3% (1)
  • B
    8% (3)
  • C
    3% (1)
  • D
    88% (35)

Explanation

Assigning secondary groups to users Use usermod command to make existing user a member of an existing group. Use -aG switch to add a new group. In this example, we make user username a member of group groupname. Note that group groupname has to be already created. > usermod -aG groupname username

Topics

#Linux user management#Group management#usermod command#User account modification

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice