Use the key pair ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub.
Apply the correct handling for authentication.
Which statement is correct?
id_rsa is the private key and stays protected on the client. id_rsa.pub is the public key copied to the server's authorized_keys.
Detailed explanation
Incorrect. The private key must not be copied to authorized_keys.
Incorrect. The private key must remain secret and the public key is the one distributed.
Correct. Keep id_rsa private and register id_rsa.pub on the destination.
Incorrect. This pair is used for user authentication, not only host keys.
Try it yourself
An example you can run in a temporary verification environment.
ssh-keygen -lf ~/.ssh/id_rsa.pubExpected result
公開鍵が存在する場合はfingerprintを表示し、秘密内容は表示しないKey points
- Private key
- Public key
- Never distribute the private key
Notes
- Environment: OpenSSH 9.x
- Use a disposable VM or test account when validating installation and SSH behavior.
- Exact command output can vary slightly by distribution and OpenSSH version.
Foundation review
Identify the scope
A user key pair is different from a server host key pair, even though both use public-key cryptography.
Check the side effect
Keep the private file on the client and compare the public-key fingerprint before registration.