Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

git push fails authorization while git clone works.

greza
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 14, 2025

Running on Linux.

I have a repository that I am the only user, so I am the admin with all the permissions.

I have set up access through SSH with SSH keys as was specified in the documentation. I am able to run git clone without any errors, but git push ends up with

---

fatal: Could not read from remote repository.

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

---

When running with ssh -vvv as suggested in one of the troubleshooting articles I can see
Authenticated to bitbucket.org (xxx:22) using "publickey".

closely followed by

Unauthorized

Any suggestion is greatly appreciated
Thank you

1 answer

0 votes
Peter_DevSamurai
Atlassian Partner
October 14, 2025

Hi Greza, 

It might be that your SSH key is likely configured with read access (cloning) but restricting write operations (pushing), possibly it being added as a repository access key instead of a personal SSH key.

A) You can try few solutions below:

  1. Verify Key Placement: Check if your SSH key is added to your personal account settings rather than the repository's access keys. Personal keys tie directly to your user permissions, which include full admin rights for pushes.

  2. Test SSH Connection: Run ssh -T git@bitbucket.org to confirm it greets you with your username (e.g., "authenticated via ssh key"). If it does, the issue is likely authorization-specific.

  3. Remote URL Check: Ensure your remote is set to git@bitbucket.org:yourworkspace/yourrepo.git (use git remote -v to verify).

B) Personal resolution (for 1 key and 1 account)

  • Go to your Bitbucket account settings -> SSH keys (under Security) and ensure your public key is added there. If not, add it following the provided guide below.
  • If the key is listed under the repository's settings -> Access keys, remove it from there -> Access keys are meant for CI/CD or read-only scenarios and can cause "unauthorized" errors for user pushes.
  • Restart your SSH agent if using one (eval "$(ssh-agent -s)" then ssh-add ~/.ssh/yourkey).
  • Try pushing again. If it persists, capture full logs with GIT_SSH_COMMAND="ssh -vvv" git push and share for more help.

You can read further in these guides:
- Troubleshoot SSH issues

- Set up personal SSH keys on Linux

 

Best, 

Peter

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events