A Linux systems administrator is setting up SSH access with PKI for several users 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
The ssh-copy-id command is specifically designed to securely copy a user’s public SSH key to a remote system’s ~/.ssh/authorized_keys file. This allows the user to authenticate via their private key without needing to manually edit files or worry about permissions and formatting. It automates the process, ensuring the key is appended correctly and that the remote SSH directory and file permissions are set securely, which is essential for maintaining SSH security.
Why the other options are incorrect:
A. Use curl to copy each user’s public key file to the respective system
Using curl is not a secure or standard method to transfer SSH keys. It doesn’t handle permissions or the proper placement of keys and can expose keys to interception if not used over secure channels.
B. Use cp to copy each user’s public key file to the respective system
The cp command is local only; it cannot copy files to a remote system by itself. Even if combined with tools like scp, it doesn’t handle permissions or key integration automatically.
D. Use ssh-copy-id to copy each user’s private key file to the respective system
This is a critical security mistake. Private keys should never be copied or shared between systems. They must remain secret and only stored securely on the client machine.
Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.
You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams