Forgetting my SSH passphrase

February 5th: I forgot my passphrase, again.

I was just trying to push my latest assignment into my Github and I was prompted for my passphrase.

$ git push -u origin master
Enter passphrase for key 'Users/me/.ssh/id_rsa':
Enter passphrase for key 'Users/me/.ssh/id_rsa':
Enter passphrase for key 'Users/me/.ssh/id_rsa':
Permission denied (publickey).
fatal: Could not read from remote respository.

Please make sure you have the correct access rights
and the repository exists.

Silly Terminal, of course I have permission and the repo exists. I just forgot the passphrase.

I actually remembered the passphrase when I was trying to reset my passphrase but for those of you on Mac, you can hopefully recover your passphrase by using this method: (The Keychain Access Method).

I luckily remembered mine while spending the time to search StackOverflow for possible solutions.

To add an SSH key check here: (Github documentation).

And to change your passphrase, go to your terminal:

$ ssh-keygen -f ~/.ssh/id_rsa -p
Enter old passphrase:
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.

If you are just changing your passphrase, your GitHub should have your key already and you should be good to go. Otherwise:

pbcopy < ~/.ssh/id_rsa.pub

copies the contents of your id_rsa key into your clipboard and go into the Settings page of Github and add a new key by pasting the id_rsa into the correct text box. (Maybe you should read this: Github Documentation on Adding a New SSH key)

Anyways, forgetting my passphrase is almost a quarterly event. The last I forgot my passphrase and I had to re-add my computer was in October 2016, so it was due time for a passphrase panic.

Advertisements

One thought on “Forgetting my SSH passphrase

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s