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

Unauthorized response from remote repository

hdittmer February 3, 2020

I have set up ssh keys and if I test the connection with "ssh -T hg@bitbucket.org" or "ssh -T git@bitbucket.org" it says the connection is successful and I can use git or hg to connect to BitBucket. I am able to clone the repository but when I attempt to push committed changes I get 

"Unauthorized
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists."

This happens for both SourceTree and the command line

3 answers

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2020

Hello @hdittmer,

Welcome to the Community.

Are you using the right SSH key? I can see you have an access key associated with the repository you're trying to push to. Access keys are read-only, so they would cause the behaviour you've observed. What exactly do you get back when you run ssh -T git@bitbucket.org?

When you use access key, response would look like this:

$ ssh -T git@bitbucket.org
authenticated via a deploy key.

You can use git or hg to connect to Bitbucket. Shell access is disabled.

This deploy key has read access to the following repositories:
dpenkin/test-repo

As you can see, the message warns that this key has only read access.

A response for a regular SSH key (associated with your account, not with a repo) looks like this:

$ ssh -T git@bitbucket.org
logged in as dpenkin

You can use git or hg to connect to Bitbucket. Shell access is disabled

Hope this helps.

Cheers,
Daniil

0 votes
hdittmer February 3, 2020

The Master branch.

0 votes
Lenin Raj
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2020

@hdittmer 

It could be because of the branch level permissions. Can you check which branch you have access to write in the settings of the repository?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events