linux 服务器非root用户挂载阿里云oss,任意用户可读写

本文以挂载 阿里云OSS 北京地域的bluck "TEST-OSS-BLUCK" 到 centos 服务器 "/OSS-BLUCKNAME" 目录为例进行说明。

1、安装ossfs

wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.6_centos7.0_x86_64.rpm
yum install ossfs_1.80.6_centos7.0_x86_64.rpm
echo BucketName:yourAccessKeyId:yourAccessKeySecret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs

2、创建要挂载的目标目录

mkdir /OSS-BLUCKNAME

3、设置权限并挂载

ossfs TEST-OSS-BLUCK /OSS-BLUCKNAME -ourl=oss-cn-beijing-internal.aliyuncs.com -oallow_other

猜你喜欢

转载自blog.csdn.net/gaoxu529/article/details/122926420