Home » CompTIA » XK0-004 » Which of the following will add jsmith to the "dba" group and preserve existing group memberships?
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?
A. usermod -a -G dba jsmith
B. usermod -g dba jsmith
C. useradd -g dba jsmith
D. groupmod dba -u jsmith
Correct Answer: AC
Explanation/Reference:
According to the reference given below. Both AC is correct. Reference:
https://www.cyberciti.biz/faq/howto-linux-add-user-to-group/
A
usermod command options summary
-g GROUP
–gid GROUP Use this GROUP as the default group.
-G GRP1,GRP2
–groups GRP1,GRP2 Add the user to GRP1,GRP2 secondary group.