【问题标题】:Can't connect to gcloud compute via ssh无法通过 ssh 连接到 gcloud 计算
【发布时间】:2020-08-29 13:10:21
【问题描述】:

我在 Google Cloud Platform 的 Compute Engine 中有实例。我的目标是通过 ssh 命令或 putty 连接到这个实例。遵循此指令(除了 Ansible 部分)https://alex.dzyoba.com/blog/gcp-ansible-service-account/ 但是当我尝试通过

连接时

ssh -i genereated-key <username of service account>@<external ip>

它给了我

主机密钥验证失败。

或

我也试过用google生成的key,但是没有区别

计算防火墙的规则是:

NAME                    NETWORK  DIRECTION  PRIORITY  ALLOW                         DENY  DISABLED
default-allow-http      default  INGRESS    1000      tcp:80                              False
default-allow-https     default  INGRESS    1000      tcp:443                             False
default-allow-icmp      default  INGRESS    65534     icmp                                False
default-allow-internal  default  INGRESS    65534     tcp:0-65535,udp:0-65535,icmp        False
default-allow-rdp       default  INGRESS    65534     tcp:3389                            False
default-allow-ssh       default  INGRESS    65534     tcp:22                              False

我应该怎么做才能通过 ssh 连接到实例?

【问题讨论】:

    标签: ssh google-cloud-platform


    【解决方案1】:

    事实证明,您无法使用 OS Login 通过 Putty/ssh 登录(至少支持代理告诉我)。所以在我的情况下,我在实例设置中添加了公钥(插入元数据)并且它可以工作。

    【讨论】:

      猜你喜欢
      • 2018-10-28
      • 1970-01-01
      • 2019-05-16
      • 2021-06-08
      • 1970-01-01
      • 2015-07-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-12
      相关资源
      最近更新 更多