Git Heroku权限拒绝公钥(添加公钥后)



我使用的是Windows 7 64位。我正在使用最新的Heroku Toolbelt和GitHub Windows应用程序(两天前下载)。两天前一切都很完美。我安装了PHP和Apache,突然Heroku给了我

Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists

我已经重复执行了这两个命令。

heroku keys:clear
heroku keys:add

我已经删除了我的密钥并重新制作了它们。我已经用其他应用程序生成了一些(puttygen)。我已经通过命令行和网络界面上传了它们。我甚至让GitHub Windows应用程序生成了一个新密钥,并上传了这个密钥。我无法从heroku获得git pushgit clone。我甚至尝试在本地创建一个新的git repo,并添加heroku作为远程,然后从那里推送。一点运气都没有。

我已经阅读了几十篇stackoverflow的帖子,并尝试了提供的每一个解决方案。没有任何帮助。

编辑:我不知道这是否重要,但我正在制作一个Facebook应用程序,并通过heroku的帮助页面工作。我已经从顶部重新启动并向下工作,但我无法通过git clone命令。我还从头开始重新安装了heroku工具带。

我经历了类似的事情-同样的错误消息,来自一个非常相似的设置(最新的heroku工具带,安装了Github windows客户端)

我认为这是git对公钥文件名的一种假设。Github的Windows客户端在$HOME/.ssh目录中创建Github_rsa和Github_rsa.pub。如果在~/.ssh目录中只看到这些,请尝试使用ssh-keygen而不是Github客户端创建一个具有标准名称(id_rsa.pub)的新目录。

我通过以下步骤解决了这个问题。

使用ssh-keygen创建一个新的公钥

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
...

现在,我在.ssh目录中有了id_rsa和id_rsa.pub以及github密钥。

然后重新上传:

$ heroku keys:add ~/.ssh/id_rsa.pub
Uploading ssh public key...

(来自http://www.whatibroke.com/?p=284通过git-push heroku主权限被拒绝(公钥)。致命:远程端意外挂断)

这就是我解决问题的方法:

我安装了heroku toobert并使用了heroku keys:remove要删除这台电脑的旧密钥,请执行以下操作:

1.
C:Program Files (x86)Gitbin添加到%PATH%中,如下所示https://stackoverflow.com/a/6318188/521088
(所以heroku密钥:add可以使用ssh-keygen)

2.heroku keys:add

完成

最新更新