CompTIA Linux+ (XK0-004) — Question 237
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?
Answer options
- A. usermod ג€"a ג€"G dba jsmith
- B. usermod ג€"g dba jsmith
- C. useradd ג€"g dba jsmith
- D. groupmod dba ג€"u jsmith
Correct answer: A, C
Explanation
The correct command to add jsmith to the 'dba' group while maintaining existing memberships is A, which uses the '-a' option. Option B replaces jsmith's primary group with 'dba', losing other memberships, while C creates a new user instead of modifying an existing one. Option D is incorrect as it attempts to modify the group rather than add a user to it.