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'…
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)- A93% (27)
- C3% (1)
- D3% (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
Community Discussion
No community discussion yet for this question.