0

Am trying to clone a private repository from bitbucket to my local machine. And am having a error below Error image I created a key from my windows local machine in cmd using ssh-key gen - t rsa -c "ussr@domain.dom" And imported the keys to bitbucket as below. preview on bitbucket

How can I resolve this issue guys? , thank you.

iamafasha
  • 848
  • 10
  • 29

1 Answers1

1

You also need to add the key to the local ssh-agent, as described at https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html.

joran
  • 2,815
  • 16
  • 18
  • I everything again and I tried to create a key again. when open cmd and run `cd %userprofile%/.ssh` then `dir id_*` To check whether I have created the key. It shows `Volume in drive C has no label. Volume Serial Number is 9267-BB95 Directory of C:\Users\TEAMLEADER\.ssh File Not Found` Does it mean my machine doesn't create the key? – iamafasha Dec 27 '18 at 15:28
  • @novapack, the key may have been created in the directory from where you run `ssh-keygen`, it depends on your environment (that is, which SSH-implementation is used) and which options you used. If not given any ouputfile OpenSSH_7.8p1 will prompt for an outputfile, using $HOME/.ssh as default destination directory, if the value does not start with a '/' will the path be a relative path from the current directory. – joran Dec 27 '18 at 20:35
  • I think I the error I hard in the comment above. I deleted the .ssh folder and created a new key without entering the **key file in which to save the key**. Added the key to the ssh-agent as you mentioned above. Now when I run `ssh -T git@bitbucket.org` I get `You can use git or hg to connect to Bitbucket. Shell access is disabled. This deploy key has read access to the following repositories: LinearcDevs/linearwebsite: Linearc -- TEAMLEADER@LINEARC-PC1` Doesn't this mean that bitbucket can now connect securely? – iamafasha Dec 28 '18 at 04:07
  • 1
    @novapack, it means that Bitbucket recognise your key (the command you run is just for testing that) and that you have read access to the repositories mentioned in the response through ssh/git protocol (e.g. `git clone git@bitbucket.....`). – joran Dec 28 '18 at 09:30
  • But still, it doesn't work it brings the same error (first image in the question) if I use git://bit..... .when I use git@bit...i get **' does not exist** and then **Could not read from remote repository.** when I use ssh:// – iamafasha Dec 28 '18 at 14:44
  • 2
    @novapack, I recommend that you verify that correct url is used when cloning the repositort from Bitbucket (see https://youtu.be/0M3LilUsX9Y) and that it correspond with the response you got when you verified the deploy key. – joran Dec 28 '18 at 18:29
  • thanks, team. it worked fine I was using `git@bitbucket.org/` instead of `git@bitbucket.org:` you the best. – iamafasha Dec 29 '18 at 06:17