【问题标题】:Google Compute Engine - troubleshooting SSH "Connection refused"Google Compute Engine - 对 SSH“连接被拒绝”进行故障排除
【发布时间】:2013-10-10 12:27:19
【问题描述】:

我正在使用以下命令访问我在 Google Compute Engine 上的实例:

gcutil ssh my-instance-name

但它给了我这个错误:

ssh: connect to host ip-address port 22: Connection refused

我检查并停用了防火墙,但我仍然收到此错误。谁能告诉我如何解决这个问题?

【问题讨论】:

  • 您似乎指的是 Google Compute Engine,而不是 App Engine 或 Cloud Storage。
  • 是的,我被推荐了,但我无法解决这个问题

标签: ssh google-compute-engine


【解决方案1】:

除非有规则允许,否则 Compute Engine 防火墙会阻止所有流量。 最常见的问题是缺少允许 SSH 的默认防火墙规则。要重新添加它,请运行:

gcutil --project=myproject addfirewall --allowed=tcp:22 default-ssh

如果不是这样,文档中有一些解决 SSH 连接问题的好建议: Troubleshooting SSH errors

【讨论】:

  • 如果您创建了一个网络而不是使用项目“默认”网络,您可能遇到了这种情况,您将通过添加 --network=new-network 在您创建的网络上运行 Brian 提到的命令.
【解决方案2】:

Google Compute Engine 防火墙也必须定义“网络”。

对于客户“网络”:

gcutil --project=yourproject addfirewall --allowed=tcp:22 default-ssh --network yournetwork

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-28
    • 2015-07-19
    • 2012-02-04
    • 1970-01-01
    • 1970-01-01
    • 2014-10-29
    • 2014-08-13
    相关资源
    最近更新 更多