Heroku“权限被拒绝(公钥)致命:无法从远程存储库读取"问题 [英] Heroku 'Permission denied (publickey) fatal: Could not read from remote repository' woes

查看:23
本文介绍了Heroku“权限被拒绝(公钥)致命:无法从远程存储库读取"问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经连续搜索了好几个小时,以寻找解决我看似容易解决的问题的方法.并不是我的搜索一无所获,而是我的搜索发现了许多不同的解决方案 - 没有一个奏效.

I've searched around for many hours on end looking to a solution to my seemingly easy-to-fix problem. It's not that my search turned up nothing, it's that my search turned up so many different solutions -none of which have worked.

无论如何,我根本无法从 Mac 的 Heroku 存储库中推送、拉取或获取.每次尝试都会给我(好像在嘲笑我)以下错误:

Anyways, I am simply unable to push, pull, or fetch from my Heroku repository from my Mac. Every attempt gives me (as if it's mocking me) the following error:

'权限被拒绝(公钥).致命:无法从远程读取存储库.'

'Permission denied (publickey). fatal: Could not read from remote repository.'

我已经尝试(并重新尝试)以多种不同的方式修复它.正如我所说,过去两天我花了很多时间四处寻找答案.以下是我尝试过的一些方法:

I've tried (and re-tried) to fix it in many different ways. As I've said, I've spent a good chunk of the last two days searching around for an answer. Here are some of the things I've tried:

  • heroku keys:clear 后跟 heroku keys:add
  • 使用 'ssh-keygen -t rsa' 自行重新生成 ssh 密钥
  • 清除我的 .ssh 目录,然后是 heroku 密钥:clear,然后是生成 ssh 密钥
  • 在 heroku 上删除我的应用程序并重新创建一个(幸运的是那里没有太多)

我可以很好地从我的 GitHub 存储库中获取数据,所以我知道这不是网络连接(ping heroku 也可以).

I can fetch from my GitHub repository fine, so I know it's not network connectivity (pinging heroku also works).

作为一种临时解决方案(我希望不会变成永久性解决方案),我已登录到我的 Ubuntu Amazon AWS ec2 实例.从 Heroku 拉和推非常有效.出于这个原因,我仍然觉得问题出在我的 Mac 上的 ssh 密钥上.两个键都显示在我的 Heroku 帐户下.关键末尾的电子邮件地址重要吗?

As a makeshift solution (that I hope doesn't turn into a permanent one), I've logged in to my Ubuntu Amazon AWS ec2 instance. Pulling and pushing to and from Heroku works perfectly. For this reason, I still feel as if the problem lies with the ssh key on my Mac. Both keys show up under my Heroku account. Does the email address at the end of the key matter?

我可以很好地从 GitHub 推送和拉取(但是我没有使用 ssh),那么为什么不使用 Heroku?

I can push and pull from GitHub fine (I'm not using ssh, however), so why not Heroku?

在这一点上,我愿意尝试任何事情.谢谢!

At this point I'm willing to try anything. Thanks!

推荐答案

我只是想分享一下我找到了自己问题的答案.

I just thought I'd share that I found the answer to my own question.

写出我的问题让我更加清楚,我进一步调查了我认为我的问题所在:ssh 密钥

Writing out my problem made it even more clear to me, and I further investigated into where I thought my problem lay: the ssh key

事实证明我是对的.问题不在于密钥本身,而在于我没有将它添加到本地 Mac 的已知 ssh 密钥列表中.因此,即使我的 Heroku 帐户上传了正确的密钥,我的 Mac 也无法对其进行身份验证,因为它在我的计算机上找不到该密钥.解决办法?

Turns out I was right. The issue wasn't with the key itself, but rather that I had not added it to my local Mac's list of known ssh keys. So even though my Heroku account had the correct key uploaded, my Mac could not authenticate with it because it could not find that key on my computer. The solution?

ssh-add ~/.ssh/id_rsa
#and, to confirm it's been added to the known list of keys
ssh-add -l

我想感谢 https://help.github.com/articles/error-permission-denied-publickey 作为一个很好的参考.

I would like to give credit to https://help.github.com/articles/error-permission-denied-publickey for being a good reference.

这篇关于Heroku“权限被拒绝(公钥)致命:无法从远程存储库读取"问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆