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

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

问题描述

当我尝试推送到我的 heroku.com 远程 git 存储库时,我收到此消息:

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

我可以使用相同的 ssh 密钥轻松处理我在 github 上的存储库 .

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

输入:

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

我使用的是 Mac OS 10.6.而且我非常无能慢慢学习!

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

更新:

$telnet heroku.com 22

给出这个输出:

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

推荐答案

连接被拒绝是一条 TCP 错误消息,指出该服务器没有在该端口上运行服务.在这种情况下,可能是 heroku.com 的 SSH 服务器没有运行.

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.

如果你没有给他们你的密钥,或者你使用了错误的私钥,ssh 会说这样的话:

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).

(以上消息表明现在heroku的SSH服务器确实在运行.)

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

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

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?

那台机器也运行一个网络服务器,所以尝试 telnet heroku.com 80 看看你是否可以连接到那台机器.

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天全站免登陆