Skip to content

Instantly share code, notes, and snippets.

@johnnymatthews
Last active January 17, 2019 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnnymatthews/d41689b21bbe1c8e30b32a5a09829b4d to your computer and use it in GitHub Desktop.
Save johnnymatthews/d41689b21bbe1c8e30b32a5a09829b4d to your computer and use it in GitHub Desktop.
This line allows you to recover your public ssh key from your private key. Assuming your private key is called `id_rsa` and you want your public key to be called `id_rsa.pub`.
# This line allows you to recover your public ssh key from your private key.
# Assuming your private key is called `id_rsa` and you want your public key
# to be called `id_rsa.pub`.
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
# Your id_rsa file needs to have the correct permissions assigned to it. Run
# this line to set them.
sudo chmod 600 ~/.ssh.id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment