Skip to content

Multiple ssh keys

Jiri Hynek edited this page Oct 13, 2017 · 4 revisions

When you are using more than a one repository, Github need you to put an unique ssh public key for each repository. Here are instructions how to do it:

  1. Go to your .ssh folder in home direstory
  2. Generate ssh key for each repository you want to use: ssh-keygen -t rsa -b 4069 -C your_github@email.com -f id_rsa.git.repository_name
  3. Create config file (its name is simple config without any file extension) host repository_name_1.github.com HostName github.com IdentityFile ~/.ssh/id_rsa.git.repository_name_1 User git

host repository_name_2.github.com HostName github.com IdentityFile ~/.ssh/id_rsa.git.repository_name_2 User git

Clone this wiki locally