我已经创建了一个标准的 Google 存储桶,我正尝试将其挂载到 CentOS Linux 计算引擎实例中,但权限似乎不允许我向除根用户(可以读取数据的用户)以外的用户授予访问权限并在使用 gcsfuse 安装后写入存储位置)。如果我尝试以非 root 用户身份挂载,gcsfuse 命令会显示已成功完成,但尝试读取或写入存储桶会导致 I/O 错误。我非常感谢任何具有在 Linux 实例中安装 Google 存储桶经验的人的指导。
最佳答案
这是 GCSFuse 的预期行为,您可以使用 -o allowed_other 标志覆盖权限,如上所述 here :
Permissions and ownership
Inodes
By default, all inodes in a gcsfuse file system show up as being owned by the UID and GID of the gcsfuse process itself, i.e. the user who mounted the file system. All files have permission bits 0644, and all directories have permission bits 0755 (but see below for issues with use by other users). Changing inode mode (using chmod(2) or similar) is unsupported, and changes are silently ignored.
These defaults can be overriden with the --uid, --gid, --file-mode, and --dir-mode flags.
Fuse
The fuse kernel layer itself restricts file system access to the mounting user (cf. fuse.txt). So no matter what the configured inode permissions, by default other users will receive "permission denied" errors when attempting to access the file system. This includes the root user.
This can be overridden by setting -o allow_other to allow other users to access the file system. Be careful! There may be security implications.
关于linux - 谷歌云存储桶: Mounting in a Linux instance with Global Permissions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39731266/