git配置多個公鑰秘鑰問題
標簽(空格分隔): git
# 生成公鑰秘鑰
ssh-keygen -t rsa -C "xx@xx.com"
第一種解決
1.ssh-add ~/.ssh/gitee_id_rsa
報錯:Could not open a connection to your authentication agent
2.ssh-agent bash
3.ssh-add ~/.ssh/gitee_id_rsa
第二種解決
創建config文件
vim ~/.ssh/config
User user1
IdentityFile ~/.ssh/id_rsa
User user2
IdentityFile ~/.ssh/gitee_id_rsa
:wq
Host:倉庫網站的別名,隨意取
HostName:倉庫網站的域名(PS:IP 地址應該也可以)
User:倉庫網站上的用戶名
IdentityFile:私鑰的絕對路徑