Use ssh-agent so a generated key's passphrase need not be entered repeatedly.
Register an existing private key with the agent.
Which command is appropriate?
ssh-add registers a private key with ssh-agent so the agent can perform signing operations.
Detailed explanation
ssh-add ~/.ssh/id_ed25519Correct. ssh-add registers the private key.
Correct. ssh-add registers the private key.
ssh-keygen -AIncorrect. ssh-keygen -A generates host keys.
Incorrect. ssh-keygen -A generates host keys.
ssh-agent -a ~/.ssh/id_ed25519Incorrect. ssh-agent -a selects the agent socket.
Incorrect. ssh-agent -a selects the agent socket.
ssh -A ~/.ssh/id_ed25519Incorrect. ssh -A enables agent forwarding for a connection.
Incorrect. ssh -A enables agent forwarding for a connection.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'ssh-add ~/.ssh/id_ed25519'Expected result
ssh-add ~/.ssh/id_ed25519Key points
- ssh-agent holds keys
- ssh-add registers
- Agent forwarding is separate
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.