Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (19 sloc) 760 Bytes

Multiple accounts for Github

Github doesn't allow you to use the same SSH key for multiple accounts, because in this case server wouldn't detect by your key which account you want to use. Fortunately, Github makes correct redirects from subdomains. Let's use it.

Add new ssh key:

ssh-keygen -t rsa -C "" -f .ssh/id_rsa_newuser
ssh-add ~/.ssh/id_rsa_newuser

Create ~/.ssh/config with following rule to say ssh use new key for new domain:

  	User git
  	IdentityFile ~/.ssh/id_rsa_ewuser

Add this line in your /etc/hosts:

That's all! Now use instead of in your remote URL.

You can’t perform that action at this time.