List fingerprints for public keys currently held by the ssh-agent connected to the current shell.
Do not add or remove keys.
Which command is appropriate?
ssh-add -l lists fingerprints of identities held by the agent. It is read-only; deletion uses different options.
Detailed explanation
ssh-add -DIncorrect. -D removes all identities from the agent.
Incorrect. -D removes all identities from the agent.
ssh-add -d ~/.ssh/id_ed25519Incorrect. -d removes the specified identity.
Incorrect. -d removes the specified identity.
ssh-add -lCorrect. It lists identities as fingerprints.
Correct. It lists identities as fingerprints.
ssh-add ~/.ssh/id_ed25519Incorrect. It adds the specified private key.
Incorrect. It adds the specified private key.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '-l=list fingerprints' '-L=list public keys' '-d=delete one' '-D=delete all'Expected result
-l=list fingerprints
-L=list public keys
-d=delete one
-D=delete allKey points
- Lowercase -l
- List fingerprints
- Distinguish delete options
Notes
- Environment: OpenSSH ssh-add option対応表
- 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.