3
votes

I do the necessary steps to create an ssh key , upload public key to bitbucket ssh keys . i then clone a repo using https . i noticed that cloning using git@XXX doesn't work and it gives a message connection to server expired.

if i clone with https the repo is cloned to my local machine without asking my bitbucket username and password. when i change the local git dir and want to push back to bitbucket repo i always get an "authentication failed" message. I'm not able to understand why i get this message? when i git push i'm prompted for username and password of bitbucket.org at the command line (mac os x) i enter my correct bitbucket username/password and i always get the authentication failed message.

I'm not sure what am i doing wrong & how to solve this problem.

---EDIT----

here is what i get after i do the following command:

git clone [email protected]:ianmayo/gnd.git/wiki
Cloning into 'wiki'...
conq: repository access denied.
fatal: The remote end hung up unexpectedly

when i test connection to bitbucket it seems it authenticates me correctly:

ssh -T [email protected]
conq: logged in as othmanelmoulat.

You can use git or hg to connect to Bitbucket. Shell access is disabled.
3

3 Answers

2
votes

If I understand correctly, the SSH-keys shouldn't have anything to do with the process, if you use the http(s) link. If your repository is public, then the http(s) link might give you read only access, which would not let you push anything back.

In short, if you want to use ssh key authentication, you should clone using the ssh-link i.e. git@XXX

2
votes

after diagnozing the problem it seems i don't have permission access to the child repo "wiki". i do have access to the parent repo gnd but for some reason in bitbucket the wiki repo under a given bitbucket repo is not visisble nor accessible via git. However i'm not sure if this is true and why the wiki folder repo is not permitted although i have permission for its main repo gnd?

---EDIT---

when we contacted the bitbucket support team they confirm they have a bug for cloning the wiki repos through ssh. below is the message we received from bitbucket team.

I've tested this and shown that it is a problem with SSH cloning of wikis. You should be able to clone it over https for now. We have opened https://bitbucket.org/site/master/issue/4600/cannot-clone-a-public-wiki-over-ssh to get this fixed asap. I'll update you again once this is complete.

Cheers, Marcus Bertrand Bitbucket Support

1
votes

If you are using bash as your shell, try running the following to diagnose the problem:

GIT_TRACE=2 git clone [email protected]:ianmayo/gnd.git/wiki