繁体   English   中英

通过 ssh 连接到 gcloud vm 实例

[英]Connecting to a gcloud vm instance via ssh

问题:

我无法通过 ssh 连接到我在 gcloud 上的 vm 实例

描述:

我在自己的域中使用 gcloud 作为用户 userid@mydomain.com

  1. 我在 Google Cloud Engine 上创建了一个 vm 实例
  2. 我通过 Cloud Launcher 安装了“Bitnami 认证的 WordPress 多站点”

虚拟机已启动并运行,我什至可以访问 wordpress 页面。 在“VM Instances”部分,我点击按钮SSH,但无法连接,window提示:

将 SSH 密钥传输到 VM。

无法连接,正在重试 (1/3)...

该日志不包含任何错误。

尝试1:Gcloud API

在 Windows CMD 中,我可以通过调用成功连接

gcloud compute ssh userid_mydomain_com@MY_INSTANCE_NAME

It generates file in C:\Users\ACCOUNT_NAME.ssh, but the file google_compute_engine.pub contains my Windows account name at the end in the format HOST\account_name@host, not my gcloud user name (userid@mydomain.com)!

我重试了 ssh 按钮,但仍然失败。 然后我将文件 google_compute_engine.pub 中的内容粘贴到 ssh 键字段中,但它仍然不起作用,可能是因为用户名错误? 我改了名字,但没有帮助。

尝试 2:PuttyGen

我还尝试使用此处所述的 PuttyGen 生成 ssh 密钥,并在密钥注释中使用 userid@mydomain.com 。 无论是否在 vm 实例配置中新生成的公钥,我都无法 ssh 进入 vm。

问题:

如何通过 ssh 按钮和腻子访问 gcloud 上的虚拟机?

更新:

我可以使用 Putty 和 WinSCP 连接到我的 vm 实例。 我输入了 Bitnami 启动板中提供的密钥文件和用户名“bitnami”。 然而,ssh 按钮仍然无法让我进入。

您可能没有使用正确的凭据。 但是,Google通过SSH按钮为您提供的Web浏览器终端无法正常工作很奇怪。

请查看下面的文档,并尝试按照以下步骤操作,它可能会对您有所帮助: https : //docs.bitnami.com/google/faq/#how-to-connect-to-the-server-through-ssh

您可以通过多种方式连接到 VM 实例:

  1. 来自谷歌云控制台的 SSH
  2. 通过云连接 shell
  3. 使用 --tunnel-through-iap 参数通过本地终端使用 gcloud 命令和 IAP 进行连接。

gcloud 计算 ssh userid_mydomain_com@MY_INSTANCE_NAME --tunnel-through-iap

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM