ssh-keygen -t ed25519 -C "user@email.com" -f ~/.ssh/id_rsa_github
ssh-keygen -t ed25519 -C "user@email.com" -f ~/.ssh/id_rsa_gitlab
# Copy Public Key to GitHub
code < ~/.ssh/id_rsa_github.pub
copy file content
# Then paste in GitHub panel
# Copy Public Key to GitLab
code < ~/.ssh/id_rsa_gitlab.pub
copy file content
# Then paste in GitLab panel
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa_github
ssh-add ~/.ssh/id_rsa_gitlab
code ~/.ssh/config
File config
# GitHub account
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_github
# Testing GitHub connection:
# ssh -T git@github.com
# Hi User! You've successfully authenticated, but GitHub does not
# provide shell access.
# GitLab account
Host gitlab.com
HostName gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_ed25519
# Testing GitLab connection:
# ssh -T git@gitlab.com
# Welcome to GitLab, @user!