Alibaba Cloud mounts oss
Steps:
# 安装软件
wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.5_centos7.0_x86_64.rpm
sudo yum localinstall ossfs_1.80.5_centos7.0_x86_64.rpm
# 写入信息
echo bucket名称:子账号AccessKeyID:子账号AccessKeySecret > /etc/passwd-ossfs
# 创建目录
mkdir /mnt/ossfs
# 进行挂载
ossfs bucket名称 /mnt/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com -o allow_other
The -ourl parameter during mounting corresponds to the EndPoint of oss, which is determined according to the selected region when creating the bucket
The -a allow_other parameter must be filled in, otherwise other users cannot operate this directory
![](http://upload-images.jianshu.io/upload_images/1864602-db3c4bfa6ec95d6f.png?imageMogr2/auto-orient/strip|imageView2/2/w/791/format/webp)
Assuming that the next step is to upload pictures through the web, the directory path for uploading pictures is:, /home/wwwroot/test/public/upload
you need to create a soft chain:
ln -s /mnt/ossfs /home/wwwroot/test/public/upload
oss-browser authorization
If there is no sub-account, create a sub-account first
![](http://upload-images.jianshu.io/upload_images/1864602-67d1d24a4ef0d456.png?imageMogr2/auto-orient/strip|imageView2/2/w/606/format/webp)
Download the oss-browser client, log in with an account with all permissions, and select the bucket to be authorized
![](http://upload-images.jianshu.io/upload_images/1864602-24624766399b475b.png?imageMogr2/auto-orient/strip|imageView2/2/w/517/format/webp)
Authorize to the corresponding sub-account
![](http://upload-images.jianshu.io/upload_images/1864602-d39489ed314b9142.png?imageMogr2/auto-orient/strip|imageView2/2/w/589/format/webp)
The sub-account must choose the corresponding oss path when logging in, namelyoss://bucket名称
![](http://upload-images.jianshu.io/upload_images/1864602-58d7dae59129e772.png?imageMogr2/auto-orient/strip|imageView2/2/w/641/format/webp)
Source: https://www.jianshu.com/p/c79d2616bd3e