简体   繁体   中英

how to set up ssh key in windows 7 machine

I am learning git.

My friend set up a git repo in his server and he give me the link for clone it. He also provide me a .ssh folder. and i see there is two file id_rsa.pub and id_rsa.

I already install git so I goto to my user folder and see there is also one .ssh folder with that two file. Now I just copy and paste my friends key pair but when I trying to clone it it ask me the password. What wrong I made ? what is the right process ?

The right process would be for you to:

  • not override your public and private key with the ones from your friend
  • not keep the public private key from your friend
  • give your own public key %HOME%\\.ssh\\id_rsa.pub to your friend for him/her to copy yhat public key in the server ~/.ssh/authorized_keys .

And make sure you start a git session using git-cmd.bat , in order for the environment variable HOME to be properly set (usually to %USERPROFILE% )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM