尝试从 Google Cloud Platform 下载时出现拒绝访问 403,但用户拥有所有访问权限

尝试从 Google Cloud Platform 下载时出现拒绝访问 403,但用户拥有所有访问权限

我们只是尝试从命令行使用 gsutil 从 Google Cloud Platform 下载一些 DCM 数据:

gsutil -m cp -R gs://dcdt_-dcm_account75701/dcm_account75701_activity_201803* C:\Users\[omissis]\Desktop\ImprData

我们收到以下错误,看起来像是访问问题,但我们已经确保在云控制台中已授予所有正确的访问权限。

AccessDeniedException: 403 [omissis] does not have storage.objects.list access to dcdt_-dcm_account75701. 
CommandException: 1 file/object could not be transferred

有人知道这是什么吗?

答案1

看起来您正在使用通配符复制多个对象:

dcm_account75701_activity_201803*

为了使其正常工作,您还需要授予用户 storage.objects.list 权限,而不仅仅是 storage.objects.get 权限。

为了验证这一点,请dcm_account75701_activity_201803*满的存储桶中某个对象的名称dcdt_-dcm_account75701

编辑:请注意storage.buckets.liststorage.objects.list是两个不同的权限。前者允许您列出属于您的项目的所有存储桶,后者(您缺少)允许您列出存储桶内的对象。

根据用户指南:

https://cloud.google.com/storage/docs/access-control/iam-roles

作为所有者,您将获得 storage.buckets.* 权限,而不是 storage.objects.* 权限。您可能希望将 storage.objectAdmin 角色授予您的用户。

相关内容