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.
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.
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:
ssh -Tv email@example.com
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
As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...
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!
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