与同一台机器上的其他用户共享安装了 gcsfuse 的存储桶

Sharing to other users on the same machine a bucket mounted with gcsfuse

几个小时以来我一直在努力,但我无法让它工作。

我在 运行 实例上成功安装了一个现有的 GCS 存储桶(我的存储桶)。我,使用 my_user,能够从已安装的存储桶中列出和复制文件。现在,同一台机器上的另一个用户需要列出并复制同一已安装存储桶中的文件,但他收到 "permission denied" 错误消息。

我阅读了访问权限部分 here。所以我尝试如下:

  1. 创建了一个名为 "bucket-users" 的组:sudo groupadd bucket-users
  2. 添加现有用户:sudo useradd -G bucket-users user_name
  3. 使用 --gid 选项装载存储桶:gcsfuse --gid 1008 my-bucket /mnt/my-bucket
  4. 安装成功:

$ ls -ltr $ drwxr-xr-x 1 my_user bucket-users 0 Sep 16 09:11 my-bucket

结果:我可以在存储桶上工作,但组 "bucket-users" 中的其他用户不能。

我哪里错了?

谢谢!

您链接到的文档的 access permissions 部分是这样说的:

As a security measure, fuse itself restricts file system access to the user who mounted the file system (cf. fuse.txt). [...]

If you know what you are doing, you can override these behaviors with the allow_other mount option supported by fuse [...] Be careful, this may have security implications!

这不仅仅是关于文件的 UID 和 GID,而是内核本身不会让任何其他人访问文件系统。您可以使用 -o allow_other 覆盖它,但请注意这可能是一个安全问题。