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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.