CompTIA Linux+ (XK0-004) — Question 197
A Linux systems administrator is setting up SSH access with PKI for several using their newly created RSA keys. Which of the following MOST securely achieves this task?
Answer options
- A. Use curl to copy each user's public key file to the respective system
- B. Use cp to copy each user's public key file to the respective system
- C. Use ssh-copy-id to copy each user's public key file to the respective system
- D. Use ssh-copy-id to copy each user's private key file to the respective system
Correct answer: C
Explanation
The correct answer is C because ssh-copy-id is specifically designed to securely install public keys to the target system’s authorized_keys file, ensuring proper permissions and security practices. Options A and B lack the necessary security features and do not handle the keys appropriately, while option D is incorrect because transferring private keys compromises security.