Last active
September 2, 2016 14:32
-
-
Save erikfloresq/b72ec0e4a9d3d1ac490503806f7bc9fa to your computer and use it in GitHub Desktop.
Create multiple indentifier with ssh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create key default | |
$ ssh-keygen | |
2. Create other key | |
$ ssh-keygen -f ~/.ssh/github_key -C "github_key" | |
3. Create 'config' file | |
$ touch config && nano config | |
4. Add Configuration in config | |
# Default for work | |
Host bitbucket.org | |
HostName bitbucket.org | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/id_rsa | |
# Github | |
Host github.com | |
HostName github.com | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/github_key | |
# Other Bitbucket | |
# Your repo of the other account is [email protected]:erikflores/iosproject.git, remove the .org and change for this git@bitbucket-account2:erikflores/iosproject.git for the host has match | |
Host bitbucket-account2 | |
HostName bitbucket.org | |
PreferredAuthentications publickey | |
IdentitiesOnly yes | |
IdentityFile ~/.ssh/bitbucket_erikflores |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment