POSIX Azure 文件共享权限
POSIX permissions for Azure File Share
我已经在我的 Ubuntu 虚拟机上安装了 Azure 文件共享。挂载点是 /mnt/azure_fileshare.
坐骑归用户"root" 所有。我尝试将其更改为特定用户。但这是不可能的。有没有人尝试过使用 POSIX 权限从服务器内部控制对 Azure 文件共享的访问?
您可以使用uid
或gid
选项设置所有权信息,参考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
我已经在我的 Ubuntu 虚拟机上安装了 Azure 文件共享。挂载点是 /mnt/azure_fileshare.
坐骑归用户"root" 所有。我尝试将其更改为特定用户。但这是不可能的。有没有人尝试过使用 POSIX 权限从服务器内部控制对 Azure 文件共享的访问?
您可以使用uid
或gid
选项设置所有权信息,参考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