2

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

gcutil ssh my-instance-name

但它给了我这个错误:

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

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

4

2 回答 2

7

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

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

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

于 2013-10-10T22:33:38.647 回答
0

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

对于客户“网络”:

gcutil --project=yourproject addfirewall --allowed=tcp:22 default-ssh --network yournetwork
于 2014-04-03T15:29:32.260 回答