The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

TAGS
AUG Leaders

Atlassian Community Events