1

I have created ssh keys in my computer and I copied the contents of id_rsa.pub to GitHub. But the ssh- and the rsa can't be on the same line.

ssh-
rsa

When I press delete, the '-' will be deleted, and the ssh and rsa will at the same line. Then input '-', the situation will go back.

Because of this ,I can't add SSH keys to GitHub.

Jeffrey Scofield
  • 65,646
  • 2
  • 72
  • 108

1 Answers1

0

I'd have to see exactly what you are doing to be sure, but I was able to add a GitHub SSH key by doing the following:

  1. Use puttygen.exe to generate a new public/private key pair.
  2. Save the public key to id_rsa.pub.
  3. Open id_rsa.pub in a text editor.
  4. Copy the lines that make up the key.
    • Do not copy the comment line or the BEGIN SSH2 and END SSH2 PUBLIC KEY lines!
  5. Log into GitHub.
  6. Click your profile pic and click "Settings".
  7. Click the "SSH and GPG keys" option.
  8. Add "ssh-rsa " (don't forget the space after rsa) to the front of the key text.

This worked for me without issue. Hoping that helps.

enter image description here

Brandon Stiff
  • 161
  • 1
  • 6