Heroku 项目的 git 克隆失败
(在苹果机上) 我正在尝试从我的新计算机克隆我的项目。我首先生成了 ssh 密钥对:
heroku keys:add /Users/y/.ssh/heroku_rsa.pub
heroku keys
显示:
ssh-rsa AAAAB3NzaC...B9DjpXg3fb [email protected]
当我尝试通过 git clone [电子邮件受保护]:xyz.git
Cloning into xyz...
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
这很奇怪。
编辑:如果我不重命名我的公钥文件,那么它就可以工作。不知何故,heroku 不喜欢重命名我的密钥。换句话说,使用默认的 id_rsa.pub 名称。
(on Mac)
I'm trying to clone my project from my new computer. I first generated the ssh key pairs:
heroku keys:add /Users/y/.ssh/heroku_rsa.pub
heroku keys
shows:
ssh-rsa AAAAB3NzaC...B9DjpXg3fb [email protected]
When I try to clone my project by git clone [email protected]:xyz.git
Cloning into xyz...
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
This is strange.
EDIT: If I don't rename my pub key file then it works. Somehow heroku doesn't like renaming my keys.. in other words, use the deault id_rsa.pub
name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有类似的问题。起初,我没有名为 id_rsa.pub 的密钥。我只有 github 的密钥:github_rsa.pub。我运行了 Heroku Keys 并发现它确实识别出了我有一把钥匙。但显然 Heroku 不喜欢那个 github 密钥。这就是我所做的:
这成功下载了该项目的所有文件。
I had a similar problem. At first, I did not have a key called id_rsa.pub. I only had a key for github: github_rsa.pub. I ran
heroku keys
and saw that it did recognize that I had a key. But apparently heroku does not like that github key. Here's what I did:This downloaded all the files for the project successfully.
您的密钥似乎未加载。默认情况下仅加载默认命名密钥(id_rsa)。使用 ssh-add 命令加载 heroku 密钥:
It looks like your key is not loaded. Only default named key (id_rsa) loaded by default. Load the heroku key by using ssh-add command:
这个简单的命令可以正常工作(前提是您的 ssh 密钥之前已正确添加)
This simple command works fine (provided that your ssh key is correctly added before)