If you should ever lose your public key, but still have your private key, you can always compute your public key from your private key.

The following command prints your public key to stdout (with id_rsa being your private key file, e.g. under ~/.ssh)

ssh-keygen -y -f id_rsa

Or just pipe directly to a file with:

ssh-keygen -y -f id_rsa > id_rsa.pub

Now you can redistribute your public key where ever you need it.

Any questions? Please comment.

Leave a comment

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