24

I want to test my keys in ~/.ssh. I do not have sshd running (Git-Bash@Windows does not provide it). I'd like to test if I still remember the passphrase for my keys.

I found these answers [1], [2], but they do not work for me.

Is there an easy way to verify my ssh keys without an ssh server?

Community
  • 1
  • 1
Juve
  • 10,584
  • 14
  • 63
  • 90

2 Answers2

48

This should work:

ssh-keygen -y

Or to avoid filename prompt question:

ssh-keygen -y -f key_file
michaelbn
  • 7,393
  • 3
  • 33
  • 46
sransara
  • 3,454
  • 2
  • 19
  • 21
0

Using SSHNet and a bunch of code you can try to open your private key and check if provided password is correct.

PrivateKeyFile key = new PrivateKeyFile(keypath, passphrase);

Above code fails if passphrase is wrong.

Marco
  • 56,740
  • 14
  • 129
  • 152