8

I downloaded and installed git from: https://git-scm.com/downloads. I can use git on Windows Command Prompt now.

I downloaded puttygen and used it to generate a pair of RSA keys, stored at D:\rsa_keys

I added the public key to my company's git website.

Now, how can I tell git to use the rsa key I just created?

mommomonthewind
  • 4,390
  • 11
  • 46
  • 74

2 Answers2

3

I think you may need to run git bash and set keys there:

  1. Start git bash (the simplest way: All Programs -> Git -> Git Bash
  2. In the git bash terminal type ssh-keygen -t rsa. This will generate public and private key pair
  3. Go to the location of the keys (I'd recommend using git bash for it) and open the public key (with cat, for example), copy it
  4. Paste the public key on your github account using Account->SSH Keys->Add key

I hope this helps.

Leo Skhrnkv
  • 1,513
  • 16
  • 27
  • 3
    This doesn't appear to answer the OP's question. They already created the keys and they already copied the public key their company's website. The question as I read it is "Given a pre-existing set of keys in a unique location, how to point local Git to find and use those keys?" – Lee Grissom Jan 16 '20 at 00:28
  • The answer to the question is mostly in the beginning: I think you may need to run git bash and set keys there: 1. Start git bash (the simplest way: All Programs -> Git -> Git Bash That's what worked for me. The other items are just to "complete" the answer with more details. If my answer is not the answer, what is your answer then? – Leo Skhrnkv Jan 16 '20 at 14:02
1

On Windows 10 I wasn't able to just use the SSH public/private key pair as generated on GitHub.

I had to first convert the private key to a .ppk format. To do this, open PuTTY Key Generator, go to Conversions -> Import Key. Choose your private key, and then click on Save private key. You'll have your private key in a .ppk file.

After that, you need Pageant (PuTTY Authenticator Agent) to be aware of that key. Open Pageant and add the private key with the .ppk file you just created.

This allowed me to authenticate with GitHub correctly.

evaldeslacasa
  • 582
  • 6
  • 17