Suddenly Can't Push/Pull Via SSH

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

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.

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

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.

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.

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.

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:<myusername>/<myreponame>.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

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

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.

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,764 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you