gpt4 book ai didi

azure - Azure 文件共享的 POSIX 权限

转载 作者:行者123 更新时间:2023-12-02 07:03:30 25 4
gpt4 key购买 nike

我已在我的 Ubuntu VM 上安装了 Azure 文件共享。挂载点为/mnt/azure_fileshare。

挂载由用户“root”拥有。我尝试将其更改为特定用户。但这是不可能的。是否有人尝试过使用 POSIX 权限从服务器内部控制对 Azure 文件共享的访问?

最佳答案

您可以使用uidgid选项来设置所有权信息,引用mount.cifs(8) - Linux man page

uid=arg sets the uid that will own all files or directories on the mounted filesystem when the server does not provide ownership information. It may be specified as either a username or a numeric uid. When not specified, the default is uid 0. The mount.cifs helper must be at version 1.10 or higher to support specifying the uid in non-numeric form. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.

例如,0700权限向文件所有者授予读、写和执行权限,但组或其他人无法访问它。您可以像这样向该所有者添加特定用户。

sudo mount -t cifs //$STORAGEACCT.file.core.windows.net/myshare /mnt/MyAzureFileShare -o vers=3.0,username=$STORAGEACCT,password=$STORAGEKEY,dir_mode=0700,file_mode=0700,serverino,uid=someuser

enter image description here

关于azure - Azure 文件共享的 POSIX 权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59776316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com