You can by adding to your HOME/.ssh
a config
file:
Host wpengine
user git
hostname git.wpengine.com
IdentityFile ~/.ssh/myPrivateKey
You can add as many 'Host' entry as you want, each one with a different IdentityFile
See for instance "Multiple SSH Keys settings for different github account"
#activehacker account
Host github.com-activehacker
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_activehacker
#jexchan account
Host github.com-jexchan
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_jexchan
You can then use the scp syntax for cloning your repo:
git clone github.com-activehacker:activehacker/gfs.git gfs_jexchan
(instead of ssh://[email protected]/activehacker/gfs.git
, which wouldn't be able to reference a specific private key and would always fall back to id_rsa
.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…