我无法使用我的部署密钥将我的存储库克隆到远程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