Find the public key belonging to a private key

Mattias Geniar, Tuesday, October 2, 2018

Here's how you can show the public key part if you have the private key.

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

This'll output your public key for SSH in the usual authorized_keys format.

$ ssh-keygen -y -f ~/.ssh/id_rsa
ssh-rsa AAAAB3....Twk5

Just in case you might need it one day!



Hi! My name is Mattias Geniar. I'm a Support Manager at Nucleus Hosting in Belgium, a general web geek & public speaker. Currently working on DNS Spy & Oh Dear!. Follow me on Twitter as @mattiasgeniar.

Share this post

Did you like this post? Will you help me share it on social media? Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *