After you create a PrivateLink endpoint for OSS in a virtual private cloud (VPC), use ossfs 1.0 to mount a bucket over the private network. Compared to the public internet, a PrivateLink connection is more secure and stable.
Prerequisites
Before you begin, ensure that you have:
Created a PrivateLink endpoint for OSS in your VPC. See Access OSS resources through the private network
Installed ossfs 1.0 version 1.91.1 or later (version 1.91.1 is the minimum version that supports the
-ouse_path_request_styleparameter)
Mount a bucket over a private network
Get your endpoint domain name from the PrivateLink console. On the Endpoints page, find the endpoint you created for OSS and copy the endpoint domain name. It follows the format:
ep-<endpoint-id>.oss.<region-id>.privatelink.aliyuncs.comRun the mount command with the endpoint domain name:
ossfs <bucket-name> <mount-point> \ -ourl=<endpoint-domain-name> \ -ouse_path_request_style \ -osigv4 \ -oregion=<region-id>Replace the placeholders with your values:
Placeholder Description Example <bucket-name>Name of the OSS bucket to mount examplebucket<mount-point>Local directory to use as the mount point /mnt/oss<endpoint-domain-name>Endpoint domain name from the PrivateLink console ep-bp1a****.oss.cn-hangzhou.privatelink.aliyuncs.com<region-id>Region where the bucket is located cn-hangzhouParameter descriptions:
Parameter Description -ourlSets the endpoint URL that ossfs uses to connect to OSS. Set this to your PrivateLink endpoint domain name, not the standard OSS endpoint. -ouse_path_request_styleSwitches ossfs to path-style URL mode, required for PrivateLink endpoints. -osigv4Enables SigV4 (Signature Version 4) request signing. -oregionSpecifies the region for SigV4 signing. Verify the mount succeeded:
df -h | grep <mount-point>If the bucket is mounted, the output shows the mount point and available space.
Example: The following command mounts examplebucket in the China (Hangzhou) region using ossfs 1.91.6:
ossfs examplebucket /mnt/oss \
-ourl=ep-bp1a****.oss.cn-hangzhou.privatelink.aliyuncs.com \
-ouse_path_request_style \
-osigv4 \
-oregion=cn-hangzhouWhat's next
ossfs GitHub repository — full list of ossfs parameters and configuration options
Access OSS resources through the private network — manage your PrivateLink endpoint