【问题标题】:Unable to connect to GCE using different google accounts无法使用不同的谷歌帐户连接到 GCE
【发布时间】:2023-03-20 11:14:01
【问题描述】:

我有两个谷歌帐户和 1 个计算引擎实例。我使用两个不同的帐户从浏览器 ssh 到它。然后我运行以下命令:

sudo gcloud compute ssh myinstance

在 account1 上成功,在 account2 上失败,并出现以下错误:

Permission denied (publickey). ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255]. See https://cloud.google.com/compute/docs/troubleshooting#ssherrors for troubleshooting hints.

我什至可以跑 sudo gcloud compute ssh account2@myinstance 以 account1 登录时成功。

如何使 account2 上的gcloud compute ssh 命令可执行?

当我尝试使用 config-ssh 命令配置 shh 键时,也会发生类似的事情。我可以在 account1 上使用 ssh myinstance 并在 account2 上收到以下错误:

ssh: Could not resolve hostname myinstance: Name or service not known

也许问题在于 account1 是实例的创建者

【问题讨论】:

  • 在没有sudo的情况下运行它?
  • 我用sudo运行所有命令

标签: ssh google-cloud-platform google-compute-engine gcloud


【解决方案1】:

也许您忘记将元数据添加到 account2 的计算引擎中

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-27
    • 2022-01-22
    • 1970-01-01
    相关资源
    最近更新 更多