XK0-004 · Question #123
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?
The correct answer is C. Use ssh-copy-id to copy each user's public key file to the respective system. ssh-copy-id is the dedicated, secure tool for installing a user's public key into a remote system's authorized_keys file to enable PKI-based SSH authentication.
Question
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?
Options
- AUse curl to copy each user's public key file to the respective system
- BUse cp to copy each user's public key file to the respective system
- CUse ssh-copy-id to copy each user's public key file to the respective system
- DUse ssh-copy-id to copy each user's private key file to the respective system
How the community answered
(51 responses)- A6% (3)
- B4% (2)
- C88% (45)
- D2% (1)
Why each option
ssh-copy-id is the dedicated, secure tool for installing a user's public key into a remote system's authorized_keys file to enable PKI-based SSH authentication.
curl is an HTTP/FTP transfer tool and has no mechanism to authenticate and place SSH public keys into the correct authorized_keys file on a remote system.
cp is limited to local filesystem operations and cannot transfer files to remote hosts or modify the remote authorized_keys file.
ssh-copy-id authenticates to the remote host using the existing credentials and appends only the user's public key to ~/.ssh/authorized_keys with correct file permissions enforced automatically. It is purpose-built for this task, prevents duplicate key entries, and avoids the manual permission errors that could silently break key-based authentication.
Copying a private key to a remote system is a critical security violation; private keys must never leave the owner's machine, as their exposure allows full identity impersonation.
Concept tested: SSH PKI public key distribution with ssh-copy-id
Source: https://man.openbsd.org/ssh-copy-id
Topics
Community Discussion
No community discussion yet for this question.