【发布时间】:2022-05-01 04:59:08
【问题描述】:
我使用以下命令在 MAC OS 终端中进行身份验证
gcloud auth login
它重定向到谷歌登录页面并显示认证过程成功。
使用命令时
gsutil -i fetebird-storage@fetebird.iam.gserviceaccount.com ls
获取异常
AccessDeniedException: Service account impersonation failed. Please go to the Google Cloud Platform Console (https://cloud.google.com/console), select IAM & admin, then Service Accounts, and grant your originating account the Service Account Token Creator role on the target service account.
但是,在云上,我确实给予了如下所示的权限
授权列表
【问题讨论】:
-
链接到另一个问题。你可以执行
gcloud config list并粘贴结果吗? -
我这边也是这样。我建议提出一个错误。根据谷歌文档,它应该通过“发送反馈”按钮(cloud.google.com/storage/docs/…)来完成,我认为这是页面cloud.google.com/storage/docs/gsutil/addlhelp/…,其中描述了
-i选项 -
我写了几篇关于服务帐户模拟的文章:jhanley.com/google-cloud-improving-security-with-impersonation 您没有在正确的资源上设置所需的角色。我的文章显示了所需的步骤。
-
@JohnHanley 如果我从云 shell 运行命令,一切正常,但是,从 MAC OS 终端我无法运行
-
gcloud auth list为每个环境显示什么?他们是否使用相同的“活动帐户”?
标签: google-cloud-platform google-cloud-storage gcloud service-accounts google-iam