Gen
ssh-keygen -t rsa -b 4096 -C "yourmail@gmail.com"
Test connection
ssh -T git@github.com
ssh -T git@gitlab.com
Config
.ssh/config
# vim: tabstop=2 shiftwidth=2 softtabstop=2
# GitLab.com
Host gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_rsa
# GitHub.com
Host github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_rsa