13

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?

7
  • 1
    Create a .ssh dir in git's home directory and it'll use them automatically. So i.e. $HOME\.ssh\id_rsa Commented Jun 25, 2018 at 12:13
  • 1
    what is $HOME in Windows? Commented Jun 25, 2018 at 12:15
  • Start your git bash and it will be the path your shell starts in at the beginning. Commented Jun 25, 2018 at 12:15
  • 3
    Have a look at How do I tell Git for Windows where to find my private RSA key? Commented Jun 25, 2018 at 12:15
  • Type pwd and you'll see your path Commented Jun 25, 2018 at 12:16

2 Answers 2

6

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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?"
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?
Following the above instructions exactly resolved my issue.
2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.