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?

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
    
I am not sure that I get this answer. Can someone explain what we mean by use "git" and "hg" as the usernames? This is the very first time I am facing this Permission denied (public key) issue, and I never paid attention to the name of my ssh users... –  Alexandre Bourlier Mar 28 at 10:37
    
The answer is confusing because OP edited the question afterwards; he originally used "someuser" as the user, implying it was his own username. For implementation reasons, Github, BB, and git/hg-hosting solutions like Gitolite or Gitlab, let all ssh clients connect under to a special service account (typically named "git" or "hg"), and only enforce ACLs afterwards based on the identity of the key. This of course doesn't apply if you are hitting a repository on a system on which you have a full ssh account. –  b0fh 23 hours ago

Your Answer

 
discard

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.