安装ossfs
wget http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32196/cn_zh/1527232195135/ossfs_1.80.5_centos7.0_x86_64.rpm?spm=a2c4g.11186623.2.6.WVXUpG&file=ossfs_1.80.5_centos7.0_x86_64.rpm
yum localinstall ossfs_1.80.5_centos7.0_x86_64.rpm
设置AccessKeyId
设置bucket name 和 AccessKeyId/Secret信息,将其存放在/etc/passwd-ossfs 文件中,注意这个文件的权限必须正确设置,建议设为640。
echo my-bucket:my-access-key-id:my-access-key-secret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
将OSS bucket mount到指定目录。
ossfs my-bucket my-mount-point -ourl=my-oss-endpoint
示例
echo my-bucket:faint:123 > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
mkdir /tmp/ossfs
ossfs my-bucket /tmp/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com
https://help.aliyun.com/document_detail/32196.html?spm=a2c4g.11186623.6.1074.nDSW2F
No Leanote account? Sign up now.