0

I want to recover my ssh public key from my private key. I am aware of this answer but it doesn't seem to work for me. When I run the command suggested ssh-keygen -f ~/.ssh/my_key -y > ~/.ssh/my_key.pub I only get the algorithm ssh-ed25519 and an ssh fingerprint not the full public key. What am I missing?

I tried making a new key and testing the command, it worked as expected. Is there something about the algorithm?

It is worth noting that the original key pair was generated by AWS.

medic17
  • 101
  • 1
  • What is the content of first line of your private key? – Romeo Ninov Jan 30 '23 at 13:53
  • `-----BEGIN OPENSSH PRIVATE KEY-----` did you mean the first line of the actual cipher? – medic17 Jan 30 '23 at 14:23
  • This is odd, from where you get this key? – Romeo Ninov Jan 30 '23 at 14:26
  • 1
    Are you sure you don't get your public key? Curve algorithms (like ed25519) generate very short keys (a public key can be less than 70 bytes). Have you actually tried to use the resulting string as an SSH public key entry? – Lacek Jan 30 '23 at 14:27
  • @Lacek that was it. please add it as an answer so I can upvote it. meybe it will help someone else in the future. At least my hunch about the algorithm was right – medic17 Jan 30 '23 at 14:49

0 Answers0