Permission denied (publickey).

Issue #9920 resolved
Stella Miranda created an issue

I had to create one ssh key for my account and other for deployment because it didn't allow me to add the same key in both sides,

I run ssh -T git@bitbucket.org

And I got this

logged in as stellamiranda. You can use git or hg to connect to Bitbucket. Shell access is disabled.

But still it doesn't allow me to deploy my code, I'm getting Permission denied (publickey).

Comments (14)

  1. Abhin Chhabra Account Deactivated

    Hi @fashionate,

    This can happen due to a variety of reasons such as 1) your public key not loaded in your Bitbucket account 2) your key not loaded onto your ssh-agent etc.

    This document does a good job of walking you through the process of troubleshooting your problems. There is a specific section for the Permission denied (publickkey) error as well that you might find useful.

    Please mark this issue as resolved if the document helps you out. If you still have issues, please feel free to comment on this issue further.

  2. Abhin Chhabra Account Deactivated

    I'm marking this issue as resolved because of lack of activity. Please reopen this issue if you need further assistance.

  3. gclaborn

    lack of activity sounds more like 'unresolved'. that's a horrible reason to mark something resolved.

    if anything dont lie and mark it 'ignored'

  4. Cam Gould

    Yeah I (and others) am having the same issue. It's not resolved. I have the SSH key in bitbucket and on my local machine, and no joy.

  5. Colleen Mayer

    I had this issue and turned out it was because I was trying to do the git command with sudo. Because when I do 'git pull origin' it shows 'cannot open .git/FETCH_HEAD: Permission denied' So I changed the owner for .get recursively and run the command without sudo then it worked. Hope this will help someone.

  6. Visual Decree

    @cmayer_logi How do you change that so a user other than root can use the .get? I'm getting the same issue

  7. Dennis Hernández

    I experienced a similar problem a few days ago. It turned out that I was using a DSA key instead of a RSA. I had to regenerate my keys.

  8. NewCityTimes

    I ran into this issue as well. It looks like my config file was wrong. I could successfully connect through ssh -T git@bitbucket.org, but got 'Permission Denied (publickey)", when I tried to run git fetch. Turns out, I had <username>@bitbucket.org:<username>:<username>.git, instead of git@

  9. Log in to comment