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

SSH authentication not being recognized

Ryan Stapleton February 21, 2022

Hi,

I'm trying to switch remote git access to my repo from https to ssh, to avoid needing to use an app password, but I can't seem to read from the repo when I change the remote. I get a "The requested repository either does not exist or you do not have access." message. When I switch the remote back to use https, it connects fine:

Screen Shot 2022-02-21 at 2.39.28 PM.png

I have referenced this documentation for creating an ssh key and I uploaded the new key to my bitbucket profile: https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/

I've referenced this page as well for changing a remote from https to ssh: https://support.atlassian.com/bitbucket-cloud/docs/change-the-remote-url-to-your-repository/

...and this troubleshooting page for help: https://support.atlassian.com/bitbucket-cloud/docs/troubleshoot-ssh-issues/

As mentioned in the documentation, I used the following command to check if I'm authenticated, it says that I am.

Screen Shot 2022-02-21 at 2.38.37 PM.png

I'm not sure what authentication I'm failing when pulling/pushing. As far as I can tell, the remote ssh path is correct. I do use another ssh key for another git project for github, so I'm wondering if this is related to local macOS key management. Perhaps by default, the ssh key for my other project is being used. I confess I've never needed to use more than one key/profile before until this project, so I'm not sure how to configure that kind of setup, or even if it's the problem at all. 

Any help or insight is appreciated, thank you.

1 answer

1 accepted

0 votes
Answer accepted
Ryan Stapleton February 23, 2022

Ok I found the problem and fixed the issue. For those who may have a similar issue, the problem wasn't in access, it was in the path itself. 

I was not the original creator of the project - I was given full admin access, but the project remains in ownership with the original developer (rice121 in the terminal snippets I provided).

The SSH path for remote access needs the workplace ID of the current owner of the project, not simply one who has all admin access/permissions as I do. I was trying to give both IDs but SSH path doesn't actually need my own in my case, thus creating a "repository does not exist" response.

So for SSH: 

git@bitbucket.com:<workplace_ID_of_current_project_owner>/<repo_name>

This is different from HTTPS connection which needs both the user name and workspace ID as part of the path:

https://<your_username>@bitbucket.org/<workspace_ID>/<repo_name>.git
Shailesh Gehlot April 27, 2022

@Ryan Stapleton isn't workplace id is rice121 in your case?

Shailesh Gehlot April 27, 2022

@Ryan Stapleton i mean when we clone the repo by ssh we just copy from bitbucket itself

Ryan Stapleton April 27, 2022

Probably in most cases that will work fine.

My issue came from the fact that I was logging into another user's project (rice121). My own workspace ID is different. I had full admin access but not ownership of the repo. So my ssh path to this project needed to remove my own ID and only use rice121 as the <workspace_ID>. 

Shailesh Gehlot April 27, 2022

i am exactly facing the same issue :(

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events