SSH key suddenly not working (Permission Denied)

CHEN TZEN KOK April 5, 2023

All these while my SSH key have been working however today when i tried to git pull it was no longer working and gave me permission denied.

debug1: Authentications that can continue: publickey

debug1: Trying private key: /Users/chentzen02/.ssh/id_ed25519_sk

debug3: no such identity: /Users/chentzen02/.ssh/id_ed25519_sk: No such file or directory

debug1: Trying private key: /Users/chentzen02/.ssh/id_xmss

debug3: no such identity: /Users/chentzen02/.ssh/id_xmss: No such file or directory

debug1: Trying private key: /Users/chentzen02/.ssh/id_dsa

debug3: no such identity: /Users/chentzen02/.ssh/id_dsa: No such file or directory

debug2: we did not send a packet, disable method

debug1: No more authentication methods to try.

git@bitbucket.org: Permission denied (publickey).

2 answers

1 vote
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2023

Hi @CHEN TZEN KOK 

Welcome to the Atlassian Community.

Could it be that you're ssh keys on your machine have been moved, deleted, or had their permission changed?
Looking at the error messages it seems that your git is not able to find any of your public ssh keys on your local machine.

Cheers,
Peter

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

Hi @CHEN TZEN KOK and welcome to the community!

If the SSH keys still exist in the ~/.ssh directory on your machine and nothing has changed with regards to their permissions, you can add the following to the ~/.ssh/config file on oyur machine

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

where id_rsa, replace with the name of the private key, whose public key you have uploaded to Bitbucket. This assumes that the SSH key pair exists in the ~/.ssh directory of your machine.

If there is no file named config in your ~/.ssh directory, you can create a new file with this name and add to it the content I shared above. This will ensure that this specific SSH key will be offered when you clone/pull/push to a Bitbucket Cloud repo via SSH.

Please feel free to let us know how it goes.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events