阿里云挂载oss
操作步骤:
# 安装软件
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
挂载时的 -ourl参数对应oss的EndPoint, 在创建bucket时根据所选地区确定
-a allow_other 参数必须要填写,不然其他用户无法操作此目录

EndPoint
假设接下来是通过web上传图片,上传图片的目录路径为:/home/wwwroot/test/public/upload
, 需要创建软链:
ln -s /mnt/ossfs /home/wwwroot/test/public/upload
oss-browser授权
如果没有子账号,先创建子账号

image
下载oss-browser客户端,使用所有权限的账号登录,选择要授权的bucket

image
授权给相应的子账号

image
子账号登录时必须选择对应的oss路径,即oss://bucket名称

出处:https://www.jianshu.com/p/c79d2616bd3e