Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SSH Access - Permission denied (publickey).

Using VSCode (running in a linux container), I am able to push changes to my bitbucket account using HTTPS, but not SSH, as I get the following...

git@bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.

AFAICT I have configured it correctly, but looking on-line, the documentation states that the format of the clone URL's should be...

HTTPS: https://<repo_owner>@bitbucket.org/<accountname>/<reponame>.git

SSH: git@bitbucket.org:<repo_owner>/<reponame>.git

However, when I login in to my bitbucket account and go to my project, the clone address for SSH is in the format git@bitbucket.org:<accountname>/<reponame>.git, which is not correct.

I have tried using git remote set-url origin to set the URL, and running, git remote -v does show the correct details, but the details in my project on my bitbucket account still shows the wrong address.

I think? this is the cause of my problem, but unless I can change it, I won't know for sure.

How do I change this URL?

1 answer

1 accepted

0 votes
Answer accepted

Hi @ron w and welcome to the community.

Regarding the clone URLs, these should be:

HTTPS: https://<username>@bitbucket.org/<workspace-id>/<repo-slug>.git

SSH: git@bitbucket.org:<workspace-id>/<repo-slug>.git

where <username> is the username of your Bitbucket account that you are authenticating with
and <workspace-id> is the Id of the workspace that owns the repo

I'm not sure what documentation you were checking, would you mind posting the link here so I can take a look, in case something is wrong in the doc?

You mentioned:

However, when I login in to my bitbucket account and go to my project, the clone address for SSH is in the format git@bitbucket.org:<accountname>/<reponame>.git, which is not correct.

Do you get this clone address from Bitbucket website, if you log in, open the repo, and from it Source page select the link Clone?

If so, the URL listed there should be the correct one and should use the workspace-id.
The workspace-id should also be visible in the address bar of your browser, while you are viewing this repo, e.g.

https://bitbucket.org/<workspace-id>/<repo-slug>/src/master/

 

1. My first suggestion here would be to change the URL of the repo to git@bitbucket.org:<workspace-id>/<repo-slug>.git as I explained above, in case it is not already like that.

 

2. Afterwards, attempt to push from VSCode.

 

3. If you still get the same error, I would suggest navigating to the repo directory from a command line tool, and try to push from command line. This is to understand whether the issue may be specific to VSCode or not.

 

4. If this fails as well, I would like to ask if you could try the push, again from command line, with the following flags:

GIT_SSH_COMMAND="ssh -vvv" <git push command>

and copy-paste the output here so we can take a look.

(Please make sure to sanitise any sensitive info from the output, e.g. usernames, workspace-ids or repo names, prior to posting it here).

The command above will give verbose output and quite possibly an indication of what may be going wrong.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Hi Theodora,

Thank you very much for your answer :-) It turns out that both you and the bitbucket site both had the correct information, and not the other various sources that I found on-line.

I didn't get the information from the bitbucket site, but from another site. I would post the URL, but I deleted all the pages about 20 minutes ago (just before I read your reply!) in jubilation of finally fixing the issue, after 12 hours!!!

The solution to the problem was two-fold...

1) When using the bitbucket/jira extension in VSCode, the SSH key MUST be called id_rsa.

2) The SSH key MUST NOT have a passshrase.

If the rules above are not adhered to, then push, pull, etc, will work from the VSCode terminal (as I just found out), but not from the menu items!

Regards

Ron

Hi Theodora,

Actually, I just found that page with the mis-information that I mentioned, and it was actually a bitbucket site. The URL is here...

https://support.atlassian.com/bitbucket-cloud/docs/configure-ssh-and-two-step-verification/

Regards

Ron

Hi Ron,

I'm glad that you managed to resolve the issue, and thanks for sharing the solution!

Thank you so much also for providing the URL of the doc, I will bring this up with the team responsible for the documentation, as I believe the URLs listed there need to be fixed.

If you need anything further, please feel free to reach out!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

258 views 2 10
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you