Check your ssh key passphrase

How can we check the passphrase of a private key?

Is it possible to do that using the following command:

ssh-keygen -y
  • If the input is the correct passphrase, it will show you the associated public key.
  • the wrong passphrase, it will display load failed.
  • If the key has no passphrase, it will not prompt you for a passphrase and will immediately show you the associated public key.

How to use multiple SSH private keys on a client

To use multiple shh private keys on a client you need to create the file config inside the folder .ssh and use the following entries:

Host myshortname realname.example.com
HostName realname.example.com
IdentityFile ~/.ssh/realname_rsa
User remoteusername

Host myother realname2.example.org
HostName realname2.example.org
IdentityFile ~/.ssh/realname2_rsa
User remoteusername

where IdentityFile is the private key for realname.