通过添加多密钥实现
- ssh-agent bash
- ssh-keygen -t rsa -C ‘xx1’ -f ~/.ssh/id_rsa_xx1
- ssh-keygen -t rsa -C ‘xx2’ -f ~/.ssh/id_rsa_xx2
- ssh-add id_rsa_xx1
- ssh-add id_rsa_xx2
vim ~/.ssh/config
Host github_xx1HostName github.comUser gitIdentityFile ~/.ssh/id_rsa_xx1
Host github_xx2HostName github.comUser gitIdentityFile ~/.ssh/id_rsa_xx2
- ssh -T -ai ~/.ssh/id_rsa_xx1 git@github_xx1
- ssh -T -ai ~/.ssh/id_rsa_xx2 git@github_xx2