Ssh – How to list keys added to ssh-agent with ssh-add

key-authenticationsshssh-agent

How and where can I check what keys have been added with ssh-add to my ssh-agent ?

Best Answer

Use the -l option to ssh-add to list them by fingerprint.

$ ssh-add -l
2048 72:...:eb /home/gert/.ssh/mykey (RSA)

Or with -L to get the full key in OpenSSH format.

$ ssh-add -L
ssh-rsa AAAAB3NzaC1yc[...]B63SQ== /home/gert/.ssh/id_rsa

The latter format is the same as you would put them in a ~/.ssh/authorized_keys file.