Bitbucket - Permission Denied (Public Key)

I have repos in github and bitbucket.

First I wanted to use same public key in bb and gh with no luck.

So I created another public key, my .ssh/config file look like this:

Host bb
    HostName bitbucket.org
    User hg
    PreferredAuthentications publickey
    IdentityFile C:/Documents and Settings/Marek/.ssh/bb

Host github
    HostName github.com
    User git
    PreferredAuthentications publickey
    IdentityFile C:/Documents and Settings/Marek/.ssh/id_rsa

bb.pub is for bitbucket. I pasted key from this file to bitbucket.

I still having

Permission denied (public key)

when I try to push my initial commit. Could somebody help?

HELP

1 Answer

You should always use "git" and "hg" as the usernames for github and bitbucket, and not your own username. The public key itself will be used to identify you.

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest