1

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 ?

1 Answer 1

4

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%)

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

2 Comments

hi @VonC thanks. He supply me the whole .ssh folder and told me clone and the. Then I can modify it and push it. But when I want to do it it shows me some warning code'Cloning into 'test-com'... warning: You appear to have cloned an empty repository.code`
@TrissaPanda the warning is expected if that git repo was empty on the server side. The clone has worked. But it is best to not reuse/share ssh private keys.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.