【发布时间】:2019-11-23 02:23:32
【问题描述】:
我正在尝试使用 gcsfuse 和服务帐户身份验证安装 GCP 存储桶。一切正常,但我只有读取权限,见下文;
hannel@gcpxxxxxxd1:~$ gcsfuse --dir-mode 777 --file-mode 777 test /testing
Using mount point: /testing
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.
hannel@gcpxxxxxxd1:~$ ls /testing/
Huh...
hannel@gcpxxxxxd1:~$ echo "test" | sudo tee -a /testing/test.log
tee: /testing/test.log: Permission denied
我已确认服务帐户具有写入存储服务的完整存储管理员权限。
我已确认实例元数据服务正在提取服务帐号
我看到的唯一问题是实例元数据服务对scopes 的调用似乎返回了“奇怪”信息https://www.googleapis.com/auth/cloud-platform
curl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/xxxxx-768@xxxx-246521.iam.gserviceaccount.com/scopes -H "Metadata-Flavor: Google"
我真的不想使用 Key JSON 解决方法
问题:
这是一个已知问题吗?
我做错了吗?
非常感谢任何帮助
【问题讨论】:
-
转到谷歌云控制台。选择您的虚拟机。在详细信息窗口的底部附近,您为“Cloud API 访问范围”设置了什么?您将需要“允许对所有 Cloud API 的完全访问”,这意味着访问由 Compute Engine 服务帐户控制。
-
Compute Engine 范围的默认设置是 Cloud Storage 的“只读”。
-
使用自定义服务账户时默认设置为full,由IAM管理。 i.imgur.com/e1lRxs0.png
-
Compute Engine 默认服务帐户的默认 IAM 设置为“允许默认访问”。这意味着许多 API 的范围有限。
标签: google-cloud-platform google-cloud-storage gcsfuse