在VISTA上git push heroku主权限被拒绝 [英] git push heroku master permission denied on VISTA

查看:162
本文介绍了在VISTA上git push heroku主权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(使用Vista)我试图从我的GitHub Repository中克隆一个应用程序,并将它推入Heroku。好的,所以我试着创建一个SSH密钥很多次:


它看起来很完美。我在我的C:/ Users / *** /。ssh文件夹中。我现在尝试克隆一个我在GitHub中分叉的应用程序。当我尝试在rails_apps目录中克隆它时,我收到一条消息:

  Permission Denied(公钥)。 

我在网上找到了一个解决方案,说我应该先运行它:

 `ssh-add` 



<所以我试图做到这一点。但它表示:

无法打开与身份验证代理的连接。

然后,找到一些关于执行ssh-agent的东西。所以我这样做:

 `ssh-agent bash` 

,命令行从我的rails_apps目录更改为:

  `bash3.1 $>`

所以我运行:

 `bash3.1 $> ssh-add [指向.ssh文件夹的路径]`

并成功添加rsa私钥(它不能与id-rsa.pub一起使用)。我也将新生成的公钥粘贴到我的GitHub帐户。



现在当我尝试克隆时:

 `bash3.1 $> git clone git@github.com:username / myrepo.git` 

现在成功克隆我在GitHub中分叉的回购。现在,我已经在本地回购的应用程序中,我尝试创建一个heroku应用程序。

 `bash3.1 $> cd myrepo` 
`bash3.1 $> heroku create myapp`

此代码成功运行。 Git远程添加成功。

 `bash3.1 $> git push heroku master` $ b $现在我需要做的就是推送它。 b  

BAM!我再次收到错误消息。



权限被拒绝(公钥)



I我是如此接近推动我的应用程序heroku。但它不会工作。你可以帮我吗。我在这里做错了什么?谢谢! :D

解决方案

注意:您的 GitHub支持票据提示答案:


你需要给heroku你的钥匙。应该有一个命令来做到这一点。如果你找不到它,你必须联系他们的支持。


为此,请参阅 Graeme Collins 回答(还有 Heroku错误:Permission denied(public key)) :

  heroku keys:add〜/ .ssh / id_rsa.pub 

请参阅 Heroku devcenter 您可以看到所有按键的列表,包括按键的名称,如下所示:

  heroku keys 

注意:假设你没有使用sudo来生成你的密钥,作为 git clone heroku ssh (code> heroku keys:add 不起作用)

$ hr

有关您的其他ssh密钥的更多信息 GitHub Support ticket

  debug1:尝试私钥:/ .ssh / identity 
debug1:尝试私钥:/.ssh/id_rsa
debug1:尝试私钥:/.ssh/id_dsa




我不确定为什么它会查看 /。ssh 而不是〜/ .ssh 然后。

尝试将您的密钥对移至该路径。







不应该是:

  git push原产大师

?默认情况下,对克隆回购的引用被称为'origin',而不是'heroku'。



什么是

  git remote -v show 

display?



您可以通过heroku名称引用远程回购

  git remote add heroku git@github.com:git_username / projectname.git 


(Using Vista)I'm trying to clone an app from my GitHub Repository and push it into Heroku. Okay, so I've tried to create an SSH key so many times with this:

 `ssh-keygen -t rsa` 

It seems to go perfectly. I have it on my C:/Users/***/.ssh folder. I now try to clone an app i forked in GitHub. When I try to clone it on the rails_apps directory, I get a message saying

 Permission Denied(public key). 

I found a solution on the net saying that I should run this first:

`ssh-add` 

So I tried doing that. But it said that:

Could not open a connection to your authentication agent.

Then after some googling I find something about executing the ssh-agent. So I do this:

`ssh-agent bash`

and the command line changes from my rails_apps directory to this:

`bash3.1$>`

So I run:

`bash3.1$>ssh-add [path to .ssh folder]`

and it successfully adds the rsa private key(it doesn't work with id-rsa.pub). I have also pasted the newly generated public key to my GitHub account.

Now when I try to clone:

`bash3.1$>git clone git@github.com:username/myrepo.git`

It now successfully clones the repo I forked in GitHub. Now that I have the app in my local repo, I try to create a heroku app.

`bash3.1$>cd myrepo`  
`bash3.1$>heroku create myapp`

And this code runs successfully. Git remote added successfully. Now all I have to do is to push it.

`bash3.1$>git push heroku master`

BAM! I get the error message again.

Permission denied (public key)

I am so close into pushing my app to heroku. But it just won't work. Can you help me. What am I doing wrong here? Thanks! :D

解决方案

Note: your ticket on GitHub Support prompted the answer:

You need to give heroku your key. There should be a command to do it. If you can't find it, you'll have to contact their support.

For that, see Graeme Collins's answer (and also Heroku error: "Permission denied (public key)" ):

heroku keys:add ~/.ssh/id_rsa.pub

See Heroku devcenter for more on that process.
You can then see a list of all keys, including the key’s name, like this:

heroku keys

Note: that suppose you didn't use sudo to generate your keys, as " git clone heroku ssh permission denied " illustrates (where heroku keys:add doesn't work)


More information about your ssh keys in your other GitHub Support ticket.

debug1: Trying private key: /.ssh/identity
debug1: Trying private key: /.ssh/id_rsa
debug1: Trying private key: /.ssh/id_dsa

I'm not sure why it would be looking at /.ssh and not ~/.ssh then.
Try moving your keypair over to that path.


Shouldn't that be:

 git push origin master

? By default, a reference to the cloned repo is called 'origin', not 'heroku'

What does

git remote -v show

display?

It you want, you can reference the distant repo by the heroku name

git remote add heroku git@github.com:git_username/projectname.git

这篇关于在VISTA上git push heroku主权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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