nerdexam
CompTIA

XK0-005 · Question #115

A user, jsmith, needs access to database files located on a server. Which of the following will add jsmith to the "dba" group and preserve existing group memberships?

The correct answer is A. usermod -a -G dba jsmith. 'usermod -a -G dba jsmith' is the correct command. The '-G' flag specifies supplementary (secondary) groups, and the '-a' (append) flag is critical - it adds the user to the specified group without removing them from any other groups they already belong to. Without '-a', '-G'…

System Management

Question

A user, jsmith, needs access to database files located on a server. Which of the following will add jsmith to the "dba" group and preserve existing group memberships?

Options

  • Ausermod -a -G dba jsmith
  • Busermod -g dba jsmith
  • Cuseradd -g dba jsmith
  • Dgroupmod dba -u jsmith

How the community answered

(29 responses)
  • A
    93% (27)
  • C
    3% (1)
  • D
    3% (1)

Explanation

'usermod -a -G dba jsmith' is the correct command. The '-G' flag specifies supplementary (secondary) groups, and the '-a' (append) flag is critical - it adds the user to the specified group without removing them from any other groups they already belong to. Without '-a', '-G' alone would replace all existing supplementary group memberships. Option B ('usermod -g') changes the user's primary group, not supplementary groups. Option C ('useradd -g') attempts to create a new user account rather than modifying an existing one. Option D ('groupmod') is used to modify group properties, not to add members to a group.

Topics

#User Management#Group Management#Linux Commands#Permissions

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice