Leo Simon
Leo Simon

Reputation: 186

access to bitbucket.org via ssh on linux

I'm trying to connect to bitbucket.org via the command line without a request for a password. I know there have been plenty of posts about this but my question is I think a bit more basic.

I'm running git version 2.7.4 on Ubuntu linux in case that matters.

I've added a public key seemingly correctly, and all my permissions on .ssh are 700. I suspect the problem is that in .git/config, I had

[remote "kss1"]
    url = https://bitbucket.org/<myName>/kss1

which several posts have identified as a problem. Based on this post I've modified the url line to

[remote "kss1"]
url = [email protected]:<myName>/kss1

And the response is now

repository access denied.
fatal: Could not read from remote repository

.Googling this error didn't yield anything terribly helpful.

Could anybody advise please?

Upvotes: 2

Views: 1331

Answers (1)

VonC
VonC

Reputation: 1329092

Check what key exactly is used with:

GIT_SSH_COMMAND='ssh -v' git push

From there, make sure your public key (used by ssh in the previous command) has been copied to your profile (SSH settings) as one line.

Make sure you don't have multiple remotes (type git remote -v) and that you are indeed using git push kss1 (by default, git push pushes to origin)


Regarding the public key copy issue, the OP Leo Simon confirms in the comments:

I guess there was a space somehow in the copy of the public key.
I remade the public key and now it's working.
No more password prompts!

Upvotes: 2

Related Questions