Last active
July 16, 2016 00:08
-
-
Save magnocosta/cc62680a05150ad28785 to your computer and use it in GitHub Desktop.
Config multiple SSH private keys on one client
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
Configurando terminal com 2 contas no Bitbucket | |
# Gerar a chave privada que acessará a conta A | |
ssh-keygen -f ~/.ssh/chave_a -C "<<seu-email-conta-a>>" | |
# Gerar a chave privada que acessará a conta B | |
ssh-keygen -f ~/.ssh/chave_b -C "<<seu-email-conta-b>>" | |
#Criar um arquivo pra orquestrar as chaves de acordo com alias | |
vim ~/.ssh/config | |
#Conteúdo do arquivo | |
Host chave_a | |
HostName bitbucket.org | |
IdentityFile ~/.ssh/chave_a | |
Host chave_b | |
HostName bitbucket.org | |
IdentityFile ~/.ssh/chave_b | |
#Clonando um projeto da conta A | |
git clone git@chave_a:repositorio/projeto-conta-a.git | |
#Clonando um projeto da conta B | |
git clone git@chave_b:repositorio/projeto-conta-b.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment