Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?


share|improve this question

1 Answer 1

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.

share|improve this answer
And this is likely his issue. Mine are 'hg' and 'git'. –  lornix Jul 6 '12 at 23:39
It's just won't work, btw I found totally different conf example: confluence.atlassian.com/download/attachments/221449711/… WTF? –  drupality Jul 7 '12 at 20:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.