无法将git推送到远程存储库:(SSH错误) [英] Cannot push git to remote repository: (SSH error)

查看:174
本文介绍了无法将git推送到远程存储库:(SSH错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


$ b

  ssh:连接到我的heroku.com远程git存储库时,我收到以下消息:

主机heroku.com端口22:拒绝连接

我可以在github上轻松使用我的存储库使用相同的ssh键。



输入:

  $ ssh git@github.com #outputs:成功消息
$ ssh git@heroku.com #outputs:ssh:连接到主机heroku.com端口22:拒绝连接

我在Mac OS 10.6上。

更新:

  $ telnet heroku.com 22 

给出了这个输出:

 尝试75.101.145.87 ... 
telnet:连接到地址75.101.145.87:拒绝连接
尝试75.101.163.44 ...
telnet:连接到地址75.101.163.44:连接被拒绝
尝试174.129.212.2 ...
telnet:连接到地址174.129.212.2:连接被拒绝
telnet:无法连接到远程主机


解决方案

拒绝连接是TCP错误消息表明该服务器未在该端口上运行服务。在这种情况下,或许heroku.com的SSH服务器没有运行。



如果您没有给他们钥匙,或者您使用了错误的私钥,ssh会说这样的事情:

  frank @ roke $ ssh git@heroku.com 
权限被拒绝(publickey)。

frank @ roke $ ssh -i〜/ .ssh / roke-frank.priv git@heroku.com
权限被拒绝(publickey)。

(上面的消息表明,现在heroku的SSH服务器确实在运行。)



由于您无法连接到我可以访问的服务器,因此可能存在防火墙问题。你在NAT后面吗?您的网关是否允许连接到远程机器上的端口22?



该机器也运行Web服务器,因此请尝试 telnet heroku.com 80 查看是否可以连接到该机器。


When I attempt to push to my heroku.com remote git repository, i get this message:

ssh: connect to host heroku.com port 22: Connection refused

I can easily work with my repository on github with the same ssh key.

Entering:

$ssh git@github.com    #outputs: success message
$ssh git@heroku.com    #outputs: ssh: connect to host heroku.com port 22: Connection refused

I'm on Mac OS 10.6. And I'm very clueless slowly learning!

UPDATE:

$telnet heroku.com 22

gives this output:

Trying 75.101.145.87...
telnet: connect to address 75.101.145.87: Connection refused
Trying 75.101.163.44...
telnet: connect to address 75.101.163.44: Connection refused
Trying 174.129.212.2...
telnet: connect to address 174.129.212.2: Connection refused
telnet: Unable to connect to remote host

解决方案

Connection refused is a TCP error message saying that that server isn't running a service on that port. In this case, perhaps heroku.com's SSH server wasn't running.

If you haven't given them your key, or you use the wrong private key, ssh will say something like this:

frank@roke$ ssh git@heroku.com
Permission denied (publickey).

frank@roke$ ssh -i ~/.ssh/roke-frank.priv git@heroku.com
Permission denied (publickey).

(And the above messages indicate that right now heroku's SSH server is indeed running.)

Since you're not able to connect to the same server to which I can, perhaps there's a firewall issue. Are you behind a NAT? Does your gateway permit connections to port 22 on remote machines?

That machine runs a web server too, so try telnet heroku.com 80 to see if you can connect to that machine at all.

这篇关于无法将git推送到远程存储库:(SSH错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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