Google Compute Engine:尝试连接到实例时出现SSH错误

罗德里克

最近几天,我尽最大努力使ssh连接从我的家用计算机运行到Google计算引擎实例,但无法实现。不幸的是,互联网上的搜索结果也没有帮助我,所以我会向你们寻求帮助:)。每个答案/建议都受到高度赞赏。

我的统计:

家用计算机:

  • 操作系统是Windows 7

  • 家用计算机的用户名与我的Google云帐户名不同

Google实例:

  • n1-standard-1,euro-west1-b
  • 操作系统:Debian GNU / Linux 8.3(jessie)[默认值]
  • 外部/静态IP:已激活
  • 允许的HTTP流量
  • 允许的HTTPS流量

其他:

  • 这是我的第一次Google云体验

  • 我仍处于免费试用期@ Google云平台

  • 我已经安装了Putty,Google SDK和Python 2.7

到目前为止我做过/尝试过的事情:

首先,我尝试通过以下命令使用Google Shell连接到我的实例:

gcloud compute ssh instance_name --zone europe-west1-b

外壳程序要求我生成shh-key,我回答“是”,然后在C:\ Users \ Lodrik.ssh \目录中获得了一个私钥+公钥。但是,在尝试连接时出现错误消息:

严重错误:断开连接:没有可用的受支持的身份验证方法(发送的服务器:publickey)

[Error_Pic] [1] //对不起,因为我的信誉点少于10,所以无法正常工作

其次,我认为可能存在问题,因为我在Google帐户中的用户名与家用PC的用户名不同。因此,我尝试使用home-pc用户名shh-conntect到我的实例:

gcloud compute ssh Lodrik@instance_name --zone europe-west1-b

结果,我刚收到一条错误消息(再次-.-)。但是,这次却是不同的。打开Putty外壳并显示以下消息:

使用用户名“ Lodrik”。服务器拒绝了我们的密钥。

[Error_Pic_2] [2] //对不起,因为我的信誉点少于10,所以无法正常工作

最后,我在stackoverflow上搜索了我的问题,并找到了该线程(类似的问题+答案):无法通过SSH连接到Compute Engine实例

因此,我遵循了线程答案中的步骤:

1)我通过Google云平台的网络仪表板手动添加了我的公钥(来自〜/ Lodrik / .shh /)

2)我复制了显示的用户名(来自此添加的公钥)和实例的IP地址,并将其输入到腻子中(如答案中所述)

3)我试图通过腻子连接到我的实例

结果,一个shell窗口打开,并询问我我的登录名。但是,无论输入什么名称,我都会收到错误消息:

服务器拒绝了我们的密钥。

Error_Pic_3

问题:

  • 有什么想法我做错了吗?

  • 为什么必须手动添加密钥?那不是自动的吗?

非常感谢你的帮助。如果您需要更多信息,请询问。我很乐意为您提供:)

最好的祝福,

罗德里克

乔治

最新的Google Cloud SDK版本中存在一个已知问题,其中新创建的密钥格式不正确,这会导致SSH问题。我们的工程团队正在努力将其修复为当务之急。为了暂时解决此问题,我建议降级Gcloud版本,创建密钥并再次更新。可以通过执行以下操作来完成:

1- Delete the .ssh folder created on your local machine
2- From the command line, run the following command:
gcloud components update --version 91.0.0
3- Once done, run the following command to create your keys:
gcloud compute ssh INSTANCE_NAME
NB: you might not be able to ssh but your keys will be created
4- Run the following command:
gcloud components update
5- Authenticate to your project:
gcloud auth login
6- Try to ssh again by running:
gcloud compute ssh INSTANCE_NAME

另一个解决方法是通过单击实例名称旁边的SSH按钮浏览器云控制台进行ssh

更新:

此处已打开“公共问题跟踪器” ,并且此问题现已修复。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

尝试连接到Google Compute Engine Ubuntu VM上托管的SQL Server时如何解决此错误

如何使用带有内置SSH的TightVNC Java Viewer连接到Ubuntu Google Compute Engine实例?

连接到Google Compute Engine实例以运行Python脚本

无法通过SSH连接到Google Compute Engine

使用Oauth连接到Google Compute Engine

SSH到Google Compute Engine实例失败

Google Compute Engine实例的GUI

SSH Google Compute Engine 关闭?

Google Compute Engine时区

将Google colab连接到Google Compute Engine实例上的运行时

无法连接到Google Compute Engine VM实例上运行的HTTP服务

无法连接到mongodb副本集Google Compute Engine

无法通过 ssh 连接到 Google Cloud Dataproc 的主节点,但可以通过 ssh 连接到 Compute Engine VM

无法使用“在浏览器中” SSH连接到Google Compute Engine

如何获取新的Google Compute Engine实例的ssh密钥?

Google Compute Engine:必需的“ compute.zones.get”权限错误

实时更新Google Compute Engine实例类型

从Jenkins Rsync到Google Compute Engine实例

Google Compute Engine VM实例访问权限

Google Compute Engine-克隆实例

重命名Google Compute Engine VM实例

Google Compute Engine:增加实例的内存/ CPU

如何移植Google Compute Engine实例?

Google Compute Engine 的配额增加

Google Compute Engine VPN DNS

VirtualBox和Google Compute Engine

Google Compute Engine-对SSH“连接被拒绝”进行故障排除

无法通过SSH连接到Compute Engine实例

将 DialogFlow 连接到 Compute Engine 实例