我無法使用我的部署密鑰將我的存儲庫克隆到遠程EC2 ubuntu實例。 以下是我遵循的步驟。使用部署密鑰(bitbucket)無法克隆EC2
- 我刪除了現有部署鑰匙我在我的帳戶到位桶
- 我打掃
~/.ssh/know_hosts
以下https://stackoverflow.com/a/26520681/808734 - 我產生我的新的密鑰以下these steps 並將其添加爲一個deployment key來回購。
這裏是
ssh -T [email protected]
You can use git or hg to connect to Bitbucket. Shell access is disabled. This deploy key has read access to the following repositories: username/repository: KEYNAME -- [email protected]
輸出但是當我嘗試克隆庫
sudo git clone [email protected]:username/repository.git
我收到以下錯誤Cloning into 'repository'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
我在這裏失去了一些東西?任何人有任何建議?
感謝您的閱讀。
'ssh-add'救了我。即使在我創建了一個新的密鑰並嘗試了這個密鑰之後,我不得不用ssh-add手動添加它。做得好! – Aarmora 2016-05-27 17:27:07
哇!做到了!如果不是問題,請告訴我真正的問題是什麼,這段代碼做了什麼? – BlackBurn027 2017-09-14 14:25:52