Git pull failed

Nagaraju
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!
April 14, 2023

Hi,

I'm facing this issue in Android Studio as below,

git@bitbucket.org: Permission denied (publickey). Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

OS -> Linux.
Website followed -> https://confluence.atlassian.com/bbkb/permission-denied-publickey-302811860.html

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 18, 2023

Hi @Nagaraju and welcome to the community!

The private SSH key you created may not be offered.

I am not sure how Android Studio handles authentication; if it using the SSH key pair you created in the ~/.ssh folder of your machine, I would suggest creating a file named config in your ~/.ssh folder and adding the following lines (if the file exists, just add the following content)

Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa


where ~/.ssh/id_rsa replace with the path and name of your private SSH key, whose public key you have uploaded to Bitbucket.

This will ensure that this specific SSH key is offered every time you clone/pull/push to a Bitbucket Cloud repo.

I would also suggest double-checking permissions: permissions should be 700 for the ~/.ssh directory, 644 for the public SSH key, and 600 for the private key.

Please feel free to let us know how it goes and if you need any further help!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events