-
Notifications
You must be signed in to change notification settings - Fork 0
Multiple ssh keys
Jiri Hynek edited this page Oct 16, 2018
·
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:
- Go to your .ssh folder in home directory
- 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
- Create config file in the .ssh folder (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
- Deploy your .pub keys to github repository according to the Github instructions: https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys:
- Clone your repository
- a. Go to the repository on Github
- b. Select clone or download
- c. Copy the link
- d. modify the link from:
git@github.com:User/repository_name.git
to:
git@repository_name.github.com:User/repository_name.git
- e. use eclipse clone tool, or command https://git-scm.com/docs/git-clone