ssh-keygen -t rsa -C "[email protected]" -b 4096 -f ~/.ssh/id_rsa_github
ssh-keygen -t rsa -C "[email protected]" -b 4096 -f ~/.ssh/id_rsa_gitlab
# Copiar chave pública para o GitHub
pbcopy < ~/.ssh/id_rsa_github.pub
# Em seguida colar no painel do GitHub
# Copiar chave pública para o GitLab
pbcopy < ~/.ssh/id_rsa_gitlab.pub
# Em seguida colar no painel do GitLab
ssh-add ~/.ssh/id_rsa_github
ssh-add ~/.ssh/id_rsa_gitlab
touch ~/.ssh/config
nano ~/.ssh/config
Arquivo config
# Conta do GitHub
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_github
# Conta do GitLab
Host gitlab.com
HostName gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_gitlab
ssh -T [email protected]
# Hi EdnilsonRobert! You've successfully authenticated, but GitHub does not provide shell access.
ssh -T [email protected]
# Welcome to GitLab, @EdnilsonRobert!
Pode ser necessário configurar o usuário no projeto
cd ~/path/to/projetc
git config user.name "User Name"
git config user.email "[email protected]"
🗿🍷