CompTIA Linux+ (XK0-005) — Question 195
Which of the following commands should a technician use to create an administrative account for the username Joe?
Answer options
- A. sudo useradd -G wheel joe
- B. sudo useradd joe; sudo passwd -l joe
- C. sudo useradd joe; sudo cat key.pem > ~/.ssh/authorized_keys
- D. sudo useradd joe; groupadd admin joe
Correct answer: A
Explanation
The correct answer is A because it uses the 'useradd' command with the '-G' option to add Joe to the 'wheel' group, granting administrative privileges. Option B locks the account after creation, which is not suitable for an admin account. Option C sets up SSH keys but does not create an admin account. Option D incorrectly uses 'groupadd' instead of 'usermod' to assign Joe to an existing group.