1. Ref:
//www.greatytc.com/p/204faf70f8bb
https://www.cnblogs.com/bdhk/p/7423329.html
2. Keys:
编辑 ~/.ssh/config
Host github
HostName github.com
AddKeysToAgent yes
UseKeychain yes
# PreferredAuthentications publickey
IdentityFile ~/.ssh/github_id_rsa
Host gitlab
AddKeysToAgent yes
UseKeychain yes
HostName git.xxx.com
# PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_id_rsa
3. 测试连接时,使用Host指定的值或HostName 指定的值
测试github
$ ssh -T git@github
测试gitlab
$ ssh -T git@gitlab