I welcome you.
I have been using their free bitbucket repository service for a long time. I haven't been able to upload and download files for a while because it throws an error: ( Before, the ssh authentication was done fine ) git pull Unauthorized fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Welcome to Atlassian Community.
This question is already resolved you can check the below thread
and below knowledge document url
https://support.atlassian.com/bitbucket-cloud/docs/configure-repository-settings/
Vikram P
Hi @wapplertibor and welcome to the community!
Did you set up SSH keys for Bitbucket Cloud on this computer in the past? I assume you did, since you mention that SSH authentication was working before. But just in case you haven't, I am sharing the links from our documentation on how to do it:
If you have already set up SSH keys on this computer, and assuming that you use OpenSSH as an SSH client, I suggest adding the following in the ~/.ssh/config of this computer (if the file doesn't exist, you can create it and add this content):
Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
where id_rsa replace with the name of your private SSH key, whose public key has been added to Bitbucket (in case it is different). Please also ensure that this key exists in the ~/.ssh directory. This configuration will ensure that this key is offered every time you clone, pull or push to a Bitbucket repo via SSH.
Another thing to check is whether you have access to this repo. Can you see this repository after you log in to https://bitbucket.org/ on your browser?
If you are still experiencing issues, can you run the git pull command with the following option and share the output here?
GIT_SSH_COMMAND="ssh -vvv" git pull
This will show more verbose output so we can investigate the issue further. Please make sure you sanitize any private data in the output before sharing it (like repo name, workspace id).
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ssh key ok.
My error, push output now:
Unauthorized
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @wapplertibor,
1. Can you access this repository on our website, https://bitbucket.org/, after you log in to your account? If this is not your own repo, have you been granted write access to it?
I can see that some repositories of your workspace were recently deleted, so I'm not sure if you're trying to pull or push to a deleted repo.
If the repository exists and you do have write access:
2. Is the git pull successful, or does the git pull also fail?
If the git pull is successful and the git push fails, please ensure that the public SSH key is added to your account settings here https://bitbucket.org/account/settings/ssh-keys/ and not as an Access key. An Access key that is added to a repo or a prject provides read-only acccess to a repo, so you will be able to clone and pull, but not push. If you have added this SSH key as an Access key, remove it from the Access keys and add it here https://bitbucket.org/account/settings/ssh-keys/.
If that step is also ok:
3. Are you using OpenSSH as an SSH client? If so, have you followed these steps from my previous reply?
If you have already set up SSH keys on this computer, and assuming that you use OpenSSH as an SSH client, I suggest adding the following in the ~/.ssh/config of this computer (if the file doesn't exist, you can create it and add this content):
Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsawhere id_rsa replace with the name of your private SSH key, whose public key has been added to Bitbucket (in case it is different). Please also ensure that this key exists in the ~/.ssh directory. This configuration will ensure that this key is offered every time you clone, pull or push to a Bitbucket repo via SSH.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.