无法通过SSH连接到Compute Engine实例 [英] Cannot connect to Compute Engine instance via SSH

查看:69
本文介绍了无法通过SSH连接到Compute Engine实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用Google Cloud Platform的Compute Engine创建了一个实例,并尝试通过SSH连接连接到该实例,但是失败了.

I've just created an instance using Google Cloud Platform's Compute Engine and tried to connect to it via SSH connection but it failed.

我正在快速入门此处.

我已经在我的PC上生成了SSH密钥,并在被询问时输入了密码.虽然我无法成功登录:-(

I have generated the SSH key on my PC and have entered the pass-phrase when asked. Though I fail to succeed a log in :-(

我得到了PuTTY SSH的错误,如下快照所示.

I got the PuTTY SSH's error as below snapshots.

然后我的PuTTY窗口处于非活动状态.

Then I get the PuTTY window inactive.

推荐答案

我遇到了同样的问题,但是找到了一种通过PuTTY手动连接的解决方法.

I have the same problem but found a workaround to connect via PuTTY manually.

  1. 为计算机实例生成SSH密钥
  2. 将SSH公钥添加到实例
  3. 准备登录-获取有关IP,登录名,密码,私有SSH密钥的信息
  4. 通过SSH客户端连接到实例,例如Windows中的PuTTY

详细步骤

对我来说,gcloud 快速启动已经:

  • 启动我的实例
  • 创建了我的公共和私有RSA密钥(在C:\Users\USER_NAME\.ssh\中)

公开密钥-C:\ Users \ USER_NAME \ .ssh \ google_compute_engine.pub

Public Key - C:\Users\USER_NAME\.ssh\google_compute_engine.pub

私钥-C:\ Users \ USER_NAME \ .ssh \ google_compute_engine.ppk

Private Key - C:\Users\USER_NAME\.ssh\google_compute_engine.ppk

  1. 在浏览器中转到Google Developers Console
  2. 选择您的项目,然后在左侧导航栏中单击:计算->计算引擎-> VM实例
  3. 您正在运行的实例将在CPU使用率图表下方链接
  4. 单击所需的链接,然后找到Add SSH key链接,然后单击它
  5. google_compute_engine.pub的全部内容粘贴到出现的字段中
  6. 单击保存",几秒钟后,密钥详细信息将出现在页面上(如果遇到错误,您将从错误的密钥文件中粘贴或未复制所有文本)
  7. 这些详细信息中的第一个单词是您的字母(区分大小写)username
  1. Go to the Google Developers Console in your browser
  2. Select your project and in the left hand nav bar click: Compute -> Compute Engine -> VM instances
  3. Your running instance(s) will be linked below the CPU usage chart
  4. Click the one you want and find the Add SSH key link and click it
  5. Paste the entire contents of google_compute_engine.pub into the field that appears
  6. Click Save and after a few seconds the key details will appear on the page (if you get an error you pasted from the wrong key file or didn't copy all the text)
  7. The first word in those details is your (case sensitive) username

  1. 在页面上找到以上External IP
  2. 打开PuTTY,然后将外部IP粘贴到主机名"中(端口默认为22)

  1. Find the External IP above on the page
  2. Open PuTTY and paste the external IP into Host Name (port is the default of 22)

在左侧导航栏中,展开:连接-> SSH,然后单击身份验证

In the left hand nav expand: Connection -> SSH and then click Auth

希望这会有所帮助.如果有人对gcloud问题有解决方案,我也很想听听.

Hope this helps. If someone has a solution for the gcloud issue I'd love to hear it too.

这篇关于无法通过SSH连接到Compute Engine实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆