相关疑难解决方法(0)

gcloudcomputessh 返回权限被拒绝(公钥)

根据Google Cloud 文档,如果我是具有“计算实例管理员”角色的项目成员,我应该能够使用 gcloud 工具连接到项目中的任何实例。

在 Google Cloud 控制台的项目 IAM 页面上,我已明确添加具有“计算实例管理员 (v1)”角色的用户名,但我仍然无法连接到由我们的某些自动化功能创建的实例。

[username]:~/src/infrastructure$ gcloud compute ssh [instance id]
Unauthorized use is strictly prohibited. All access and activity
is subject to logging and monitoring.
Permission denied (publickey).
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
Run Code Online (Sandbox Code Playgroud)

我似乎能够连接到的唯一实例是我创建的实例。

这里可能出了什么问题?

附带说明一下,根据此文档,我应该能够手动将 RSA 公钥添加到实例,然后使用 SSH 进行连接。

我将公钥添加~/.ssh/google_compute_engine.pub到实例元数据中,然后尝试使用 SSH,但没有成功。

[username]:~/src/infrastructure$ ssh -i ~/.ssh/google_compute_engine [public ip of instance]
Unauthorized use is strictly prohibited. All access and activity is subject to logging …
Run Code Online (Sandbox Code Playgroud)

ssh google-cloud-platform gcloud

12
推荐指数
3
解决办法
2万
查看次数

标签 统计

gcloud ×1

google-cloud-platform ×1

ssh ×1