Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset or change the passphrase for a GitHub SSH key?

I have forgoten my passphrase in Git. How do I reset it? I found two solutions on Stack Overflow, but I want to know what process to follow to reset it or to get it.

like image 672
Tech MLG Avatar asked Apr 17 '12 10:04

Tech MLG


People also ask

How do I change my passphrase in GitHub?

You can change the passphrase for an existing private key without regenerating the keypair by typing the following command: $ ssh-keygen -p -f ~/.

How do I add a passphrase to an existing SSH key?

Adding or replacing a passphrase for an existing key To change your passphrase, you can simply run the ssh-keygen -p command. Specify the location of your current key, and input any old or new passphrases. There is no need to regenerate keys.

How do I recover my passphrase?

"Forgot your encryption passphrase? If you forget your passphrase, you'll need to reset sync via the Google Dashboard. This will delete all synced data from Google's servers and disconnect all synced computers and devices, but not the data that's on your computers or devices.


1 Answers

If you had generate a SSH-key with passphrase and then you forget your passphrase for this SSH-key,there's no way to recover it, You'll need to generate a brand new SSH keypair or switch to HTTPS cloning so you can use your GitHub password instead.

BUT,there are exceptions

If you configured your SSH passphrase with the OS X Keychain, you may be able to recover it.

  1. In Finder, search for the Keychain Access app.
  2. In Keychain Access, search for SSH.
  3. Double click on the entry for your SSH key to open a new dialog box.
  4. Keychain access dialogIn the lower-left corner, select Show password.
  5. You'll be prompted for your administrative password. Type it into the "Keychain Access" dialog box.
  6. Your password will be revealed.

Refer to Github help - How do I recover my SSH key passphrase?

like image 192
liangzr Avatar answered Nov 17 '22 05:11

liangzr