git push heroku master 权限被拒绝(公钥).致命:远端意外挂断 [英] git push heroku master Permission denied (publickey). fatal: The remote end hung up unexpectedly

查看:41
本文介绍了git push heroku master 权限被拒绝(公钥).致命:远端意外挂断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅我有点沮丧,因为 Heroku 使用 SO 作为他们的客户支持(我认为至少可以说这是劣质的),我会尽量保持检查.

Please excuse a bit of frustration, which I will try to keep in check since Heroku is using SO as their customer support (which I think it shoddy to say the least).

在过去的五个小时里,我一直在尝试发布一个应用程序,但密钥总是出现问题.我已经阅读了数十篇文章并尝试了一个又一个的提示,试图找出 Heroku 在愚蠢的、完全不透明的过程中出错的地方.

For the last five hours I have been trying to get an application to publish, but invariably something goes wrong with the keys. I've read dozens of articles and tried tip after tip in an effort to figure out where, in the stupid, completely opaque process Heroku is screwing up.

我的用例并不难:我为我的 heroku 应用程序创建了一个新的密钥对.我已将该密钥设置为我的密钥:

My use case is not that difficult: I have created a new keypair for my heroku apps. I have set that key to be my key:

  > heroku keys
  === travis@xxxx.com Keys
  ssh-rsa AAAAB3NzaC...avOqfA7ZBd travis@xxxx.com

我可以毫无问题地登录并创建"一个应用程序(愚蠢的名字,因为它似乎正在创建一个 git 存储库,而不是任何类型的应用程序).但是每次 *该死的* 时间我尝试推送我的应用程序,我得到:

I can log in and "create" an application (stupid name, since it seems to be creating a git repo, not any sort of app) without problem. But every *freaking* time I try to push my app, I get:

  > git push heroku master
  Permission denied (publickey).
  fatal: The remote end hung up unexpectedly

我不了解 WTF 的进展情况;我只是被困在键盘上,无法追索,但希望谷歌的全能之神能够回答它.谷歌没有回答这个问题(好吧,让我收回这个问题,我已经看到了大约十几种回答这个问题的方法).

I have no insight into WTF is going on with it; I'm just stuck banging my head against a keyboard with no recourse but to hope the almighty god of Google can answer it. And google isn't answering it (well, let me take that back, I've seen about a dozen ways to answer this).

对于一个本该简单的系统来说,这是个笑话.我喜欢 Heroku 的想法,但是在花费了 5 次完全什么都没有完成之后,我想这可能是错误的选择.

For a system that is supposed to be easy, this is a joke. I like the idea of Heroku, but after taking five our to get absolutely nothing done, I'm thinking maybe it is the wrong choice.

推荐答案

网络上有多种解决方案.我将尝试将可用选项浓缩到一篇文章中.请在每一步后重新尝试连接.

There are a variety of solutions around the web. I will try to condense the available options into one post. Please try your connection again after every step.

  • 第 1 步:尝试将您的公钥添加到 Heroku

  • Step 1: Attempt adding you public key to Heroku

heroku keys:add ~/.ssh/id_rsa.pub // or just heroku keys:add and it will prompt you to pick one of your keys

  • 第 2 步:生成一组新的 SSH 密钥,然后再次尝试第一步

  • Step 2: Generate a new set of SSH keys, then attempt the first step again

    https://help.github.com/articles/generating-ssh-keys

    第 3 步:验证和/或修改您的配置文件

    Step 3: Verify and/or modify your config file

    vim ~/.ssh/config
    
    Host heroku.com
    Hostname heroku.com 
    Port 22 
    IdentitiesOnly yes 
    IdentityFile ~/.ssh/id_rsa    <--- Should be your public SSH key
    TCPKeepAlive yes 
    User jsmith@gmail.com
    

  • 第 4 步:从 git 中删除 heroku 远程,重新创建连接,通过 heroku create 添加远程将仅是新存储库的一个选项.请务必删除您最初尝试创建的旧存储库

  • Step 4: Remove the heroku remote from git, the recreate the connection, adding the remote via heroku create will only be an option for new repositories. Be sure to delete your old repo that you originally attempted to create

     $ git remote rm heroku
     $ heroku create
    

  • 步骤 5:重新安装 Heroku Toolkit

  • Step 5: Reinstall Heroku Toolkit

    这篇关于git push heroku master 权限被拒绝(公钥).致命:远端意外挂断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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