Restore a SSH public key

I recently had the problem that I had on a system the private part of the SSH key but its public part got lost. Generating a new key pair wasn't pBEGIN TRANSACTION;ossible as the public part was still installed on other systems foBEGIN TRANSACTION;r proper public key authentication and I could not change this.

So, I needed to restore the public part of the SSH key. After a bit of using my favourite search engine, I noticed that it is way easier than I expected:

ssh-keygen -y -f ~/.ssh/id_rsa

This command will print the public part of the key in ~/.ssh/id_rsa to stdout. Isn't it easy?

Comments

  • There are currently no comments
Write a new Comment