An SSH client compares a previously seen server host key with the key presented now.
Which file stores this comparison data?
~/.ssh/known_hosts stores remote host public keys and helps detect impersonation or unexpected key changes.
Detailed explanation
~/.ssh/authorized_keysCorrect. known_hosts records remote host keys.
Correct. known_hosts records remote host keys.
~/.ssh/known_hostsIncorrect. authorized_keys is server-side user-key authorization.
Incorrect. authorized_keys is server-side user-key authorization.
~/.ssh/id_ed25519Incorrect. id_ed25519 is the client's private key.
Incorrect. id_ed25519 is the client's private key.
/etc/shadowIncorrect. /etc/shadow stores local authentication data.
Incorrect. /etc/shadow stores local authentication data.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' '~/.ssh/known_hosts stores server host keys'Expected result
~/.ssh/known_hosts stores server host keysKey points
- Remote host keys
- known_hosts
- Different from authorized_keys
Notes
- Environment: OpenSSH clientのファイル役割
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.