Allow a client public key to log in as server-side user deploy.
Choose the standard file under the deploy account.
Which file should receive the key?
The server account's ~/.ssh/authorized_keys lists client public keys and options permitted for public-key authentication.
Detailed explanation
~deploy/.ssh/known_hostsIncorrect. known_hosts records server host keys seen by the client.
Incorrect. known_hosts records server host keys seen by the client.
~deploy/.ssh/id_ed25519Incorrect. It is deploy's private user identity key, not the login allowlist.
Incorrect. It is deploy's private user identity key, not the login allowlist.
~deploy/.ssh/authorized_keysCorrect. It lists client public keys authorized for deploy.
Correct. It lists client public keys authorized for deploy.
/etc/ssh/ssh_host_ed25519_key.pubIncorrect. It is the server host identity public key, not a user allowlist.
Incorrect. It is the server host identity public key, not a user allowlist.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'authorized_keys=allowed client public keys' 'known_hosts=trusted server host keys'Expected result
authorized_keys=allowed client public keys
known_hosts=trusted server host keysKey points
- Place it under the server account
- Store only the public key
- Distinguish known_hosts
Notes
- Environment: OpenSSH authorization file対応表
- 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.