Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Suddenly Can't Push/Pull Via SSH

George Irwin April 21, 2013

I've created a new repo on BitBucket, set up my SSH keys and was successfully pushing/pulling using that key over SSH. Everything worked 100% for three or four days, now suddenly, I get:

conq: repository access denied.

Whenever I try to push/pull/fetch. I've checked my git config file and my .ssh/known_hosts and everything looks exactly correct....... It's been like this for a day or two now.

Any ideas?

2 answers

0 votes
aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2013

Does this suggest there's a problem with my .ssh config

Yes, it does.

Look at your Git config, your URL contains Bitbucket, but your ~/.ssh/config file contains named hosts of firstHost and secondHost. Chage the URL in your git config to match your named host to use the correct key. For example:

url = git@secondHost:<username>/<repo_slug>.git

George Irwin April 21, 2013

Sorry Marcus - that is a typo. I changed the Host names in the comment for privacy reasons (my names are pretty descriptive) and forgot to use the same replaced host name in the git config. So in reality, they do match.

aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2013

If you'd prefer, reply to the private issue with specific details from your config. I still think this is the root cause of the issue. Also, please include the reply from Bitbucket from ssh.

0 votes
aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2013

This error means that you don't have permission to the repository on Bitbucket. Is this a repository you own? Is it possible you are over your plan limit?

You should log in to Bitbucket and take a look at the repo to ensure you still have access.

George Irwin April 21, 2013

There's no indication on BitBucket that anything is wrong.... My plan is "5 Users" and I'm the repo owner... I can view all the code in the repo on BitBucket

aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2013

Can you either report your username and the URL of the repo you are accessing here? Or privately to support.atlassian.com under the Bitbucket project.

George Irwin April 21, 2013

Have created an issue:

JST-62743

I couldn't create it under the BitBucket project - kept being sent round in circles from validating my support entitlement to OnDemand Support. Gave up after a few frustrating attempts.

aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2013

Thanks for the information in private. It sounds like you may be sending us a different key than you have regsitered. From our SSH Troubleshooting Guide, try the following:

Check

ssh -Tv git@bitbucket.org

This will show you which user, if any, is authenticating on Bitbucket. If you get access denied outright, then see which key you are offering Bitbucket. This can also be checked/configured in ~/.ssh/config. You should have a Host entry for Bitbucket. Ensure that the private key being offered there is the matching public key for your user in Bitbucket. Finally, be sure your SSH key is registered on your actual user account and not as a deployment key.

For more troubleshooting, check out that doc.

George Irwin April 21, 2013

Running your suggested code, it only tests the login for my other bitbucket repo (which works 100%). Does this suggest there's a problem with my .ssh config:

Host firstHost
    HostName bitbucket.org
    IdentityFile ~/.ssh/id_rsa

Host secondHost
    HostName bitbucket.org
    IdentityFile ~/.ssh/BitBucket

Or is the issue in my git config for the failing repo:

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = git@BitBucket:&lt;myusername&gt;/&lt;myreponame&gt;.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events