Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage


I have 2 github accounts with different ssh keys. I have reconfigured my .ssh/config to use my rburgst account on github, however, when I try to clone a private repo using it always tries to use id_rsa rather than id_rsa_github.

see my .ssh/config file below




IdentityFile ~/.ssh/id_rsa_github

2 answers

1 accepted

0 votes
Answer accepted

Actually, the Host and HostName of the original post are the correct ones:

Host public-github
        User yourown_username
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/id_github_pub
        IdentitiesOnly yes

I think your config file is incorrect, you've mixed 'Host' and 'Hostname' with the same setting, they need to be different. Also your user name looks wrong, it will need to be your GitHub user name and not your email (I know that GitHub lets you log in with your email, but that's not the actual name of your account, and that's what SSH uses).

Try this:

Hostname GitHub1
User your_github_account_name_not_email
IdentityFile ~/.ssh/id_rsa_github

Hostname GitHub2
User your_github_account2_name_not_email
IdentityFile ~/.ssh/id_rsa

Then when you use the host, you use the friendly host name (GitHub1, GitHub2) as host aliases to these configurations instead of

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Atlassian Community Events

Hello from city #68 on the road!

Hello from my sixty-eighth city in a long-term RV trip I started in 2015!  I've traveled all over the US staying in different cities and states for just a few days up to many months. This week I...

43 views 1 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you