ssh-keygen -t ed25519 -C "[email protected]" -b 4096 -f ~/.ssh/id_ed25519_github
ssh-keygen -t ed25519 -C "[email protected]" -b 4096 -f ~/.ssh/id_ed25519_gitlab
# Copiar chave pública para o GitHub
cat ~/.ssh/id_ed25519_github.pub
# Em seguida colar no painel do GitHub
# Copiar chave pública para o GitLab
cat ~/.ssh/id_ed25519_gitlab.pub
# Em seguida colar no painel do GitLab
# ssh-add -D //remover chaves anteriores
ssh-add ~/.ssh/id_ed25519_github
ssh-add ~/.ssh/id_ed25519_gitlab
touch ~/.ssh/config
nano ~/.ssh/config
Arquivo config
# Conta do GitHub
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_ed25519_github
# Conta do GitLab
Host gitlab.com
HostName gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_ed25519_gitlab
ssh -T [email protected]
# Hi thiagoalvesfoz! You've successfully authenticated, but GitHub does not provide shell access.
ssh -T [email protected]
# Welcome to GitLab, @thiagoalvesfoz!
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]"