This topic describes how to use parameters to configure user access permissions for a mount point when you mount a bucket using ossfs.
Prerequisites
Scenarios
Share access permissions for the mount point directory: Allow other users to access the mount point directory.
Share access permissions for the mount point directory and its files: Allow all users to access the mount point directory and to read, write, and execute the files within it.
Share access permissions for the mount point directory and customize file permissions: Allow other users to access the mount point directory and set custom permissions for different users to access files within the mount point.
Parameters
Option | Description |
allow_other | Grants other users on the computer access permissions to the mount directory, but not to the files within it. To change file access permissions in the directory, use the chmod command. This option does not require a value. To enable it, add the -oallow_other option. |
umask | Sets the permission mask for files and directories within the mount point. For example, to set permissions to 770, add -oumask=007. To set permissions to 700, add -oumask=077. |
Mounting examples
Share access permissions for the mount point directory
To mount an OSS bucket named
mybucketto the local/mnt/ossdirectory and allow other users to access this directory, run the following command.ossfs mybucket /mnt/oss -ourl=http://oss-cn-****.aliyuncs.com -oallow_otherSetting access permissions for a mount point directory and its files
To mount the OSS bucket
mybucketto the local/mnt/ossdirectory and grant all users permission to access the directory and read, write, and execute the files within it, run the following command.ossfs mybucket /mnt/oss -ourl=http://oss-cn-****.aliyuncs.com -oallow_other -oumask=000Share access permissions for the mount point directory and customize file permissions
NoteYou can customize the
-oumaskparameter value to grant different file access permissions to different users within the mount point.To mount an OSS bucket named
mybucketto the local/mnt/ossdirectory, allow other users to access the directory, and grant read and write permissions for files only to the owner and group, run the following command.ossfs mybucket /mnt/oss -ourl=http://oss-cn-****.aliyuncs.com -oallow_other -oumask=007