- Generate ssh keys by following one of these tutorials:
- After added SSH keys successfully, you should check by listing ssh keys:
ssh-add -l
- Configure
~/.ssh/config
:
# Work
Host git.company.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
# Personal
Host github.com gitlab.com bitbucket.org
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa_individual
- Test added SSH keys
ssh -T git@git.company.com
ssh -T git@gitlab.com
ssh -T git@bitbucket.org
ssh -T git@github.com