![](/img/trans.png)
[英]How to properly configure ssh keys to multiple remote accounts involving github and bitbucket?
[英]Multiple ssh keys for multiple accounts on bitbucket/github, not working
即使有很多關於此主題的問題,我也很難嘗試完成這項工作。 我丟失了某些東西,或者它們不是我想要的。
我有兩個帳戶在github - account1
和account2
各自的資料庫
git@bitbucket.org:account1/repo.git
git@bitbucket.org:account2/repo.git
在我的PC上,我為每個一個account1_id_rsa
和account1_id_rsa
創建了2個單獨的SSH密鑰
當我將它們命名為id_rsa
時,它們都可以單獨工作,並且默認情況下它們都可以工作。 但是我希望能夠保留它們分別名為account1_id_rsa
和account1_id_rsa
密鑰,並且仍然能夠進行推/拉操作而不必根據當前要處理的存儲庫來重命名每個密鑰。
在閱讀了有關該主題的許多QA之后,我仍然不知道要在.ssh\\config
放入什么。 到目前為止,我已經嘗試過
Host bitbucket
HostName bitbucket.org
IdentityFile ~/.ssh/account2_id_rsa
User account2
Host bitbucket
HostName bitbucket.org
IdentityFile ~/.ssh/account1_id_rsa
User account1
在這里找到答案
http://kevinpelgrims.com/blog/2012/07/19/setting-up-multiple-github-accounts-on-windows
Host account1.bitbucket
HostName bitbucket.org
IdentityFile ~/.ssh/account1_id_rsa
Host account2.bitbucket
HostName bitbucket.org
IdentityFile ~/.ssh/account2_id_rsa
最重要的是,我需要具有以下git URL
git@account1.bitbucket.org:repo.git
git@account2.bitbucket.org:repo.git
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.