XK0-005 · Question #364
An administrator wants to be able to access a remote server. After creating an SSH key pair, which of the following describes where the public key should be placed to allow for key-based…
The correct answer is A. -/, ssh/authorized_keys. To enable SSH key-based authentication, the public key generated on the client machine must be placed in the ~/.ssh/authorized_keys file on the remote server.
Question
An administrator wants to be able to access a remote server. After creating an SSH key pair, which of the following describes where the public key should be placed to allow for key-based authentication?
Options
- A-/, ssh/authorized_keys
- B-/ssh/id_ras.pub
- C-/.ssh/known_hosts
- D-/.ssh/config
How the community answered
(34 responses)- A91% (31)
- B3% (1)
- D6% (2)
Why each option
To enable SSH key-based authentication, the public key generated on the client machine must be placed in the `~/.ssh/authorized_keys` file on the remote server.
On the remote server, the user's public key must be copied into the `~/.ssh/authorized_keys` file within the home directory of the user attempting to log in. SSH uses this file to verify the client's private key during the authentication process, allowing secure access without requiring a password.
`~/.ssh/id_rsa.pub` is the default location for the client's *own* public key on the *client machine*, not where public keys are placed on the remote server for authentication.
`~/.ssh/known_hosts` stores the public keys of *remote servers* the client has connected to, which is used to verify the server's identity, not for client authentication to the server.
`~/.ssh/config` is a client-side configuration file used to define custom SSH connection settings for different hosts, not for storing public keys on the remote server for authentication.
Concept tested: SSH key-based authentication; authorized_keys file
Source: https://www.ssh.com/academy/ssh/authorized_keys
Topics
Community Discussion
No community discussion yet for this question.