You can configure user permissions on a local mount-point directory when you use ossfs to mount an Object Storage Service (OSS) bucket.
Prerequisites
-
OSS is activated.
-
A bucket is created. For more information, see Create a bucket.
-
ossfs is installed.
Scenarios
-
Share the permissions to access a directory to which a bucket is mounted: Other users can access the mount-point directory but not the files in it.
-
Share the permissions to access a directory to which a bucket is mounted and the permissions to write, read, and execute all files in the directory: Other users can access the mount-point directory and have full read, write, and execute permissions on all files in it.
-
Share the permissions to access a directory to which a bucket is mounted and specific permissions on files in the directory: Other users can access the mount-point directory and have custom permissions on files in it.
Parameters
|
Parameter |
Description |
|
allow_other |
Allows other users to access the mount-point directory, but not the files in it. You can run the chmod command to modify file permissions separately. No value is required. To enable this option, add -oallow_other. |
|
umask |
Sets the permission mask for files and folders in the mount-point directory. For example, -oumask=007 sets the permissions to 770, and -oumask=077 sets the permissions to 700. |
Mounting examples
-
Share the permissions to access a directory to which a bucket is mounted
To mount an OSS bucket named
mybucketto a local directory named/mnt/ossand grant other users access to the directory, run the following command:ossfs mybucket /mnt/oss -ourl=http://oss-cn-****.aliyuncs.com -oallow_other -
Share the permissions to access a directory to which a bucket is mounted and the permissions to write, read, and execute all files in the directory
To mount an OSS bucket named
mybucketto a local directory named/mnt/ossand grant other users full read, write, and execute permissions on the directory and its files, run the following command:ossfs mybucket /mnt/oss -ourl=http://oss-cn-****.aliyuncs.com -oallow_other -oumask=000 -
Share the permissions to access a directory to which a bucket is mounted and specific permissions on files in the directory
NoteUse the
-oumaskparameter to grant different permissions on files to different users.To mount an OSS bucket named
mybucketto a local directory named/mnt/ossand grant other users read, write, and execute permissions on the files, run the following command:ossfs mybucket /mnt/oss -ourl=http://oss-cn-****.aliyuncs.com -oallow_other -oumask=000