生成兩個key後,添加到對應服務器的 ssh kyes管理設置 中。
本地添加私鑰
本地添加私鑰名命令ssh-add ~/.ssh/Your Key Name,如果出現“Could not open a connection to your authentication agent”的問題,可以執行命令ssh-agent bash,再運行添加命令。另外,可用通過
3.壹點說明
以上的我采用的是oschina的碼雲和github的兩種kye的結合體,其中每段最後的IdentityFile跟著是妳自己ssh key的名字,不要搞錯了。
最後就是測試咯
oschina的測試方法ssh -T git@git.oschina.net;成功收到的回復為“Welcome to Git@OSC,‘Your Name’ ”
github的測試方法ssh -T git@github.com;成功收到的回復為”Hi ’Your Name‘ ! You’ve successfully authenticated, but GitHub does not provide shell access.“
借鑒文章
git 配置多個SSH-Key
管理git生成的多個ssh key
---------------------本文來自 來不及解釋了快上車 的CSDN 博客 ,全文地址請點擊:/code-snippet/37443/git-ssh-add-.ssh-id_rsa-Could-not-open-a-connection-to-your-authentication-agent