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,218
  • 12
  • 61
  • 87

2 Answers2

48

This should work:

ssh-keygen -y

Or to avoid filename prompt question:

ssh-keygen -y -f key_file
michaelbn
  • 6,909
  • 2
  • 31
  • 45
sransara
  • 3,376
  • 2
  • 18
  • 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
  • 55,302
  • 13
  • 128
  • 150