> 文章列表 > 阿里云ecs服务器挂载oss

阿里云ecs服务器挂载oss

阿里云ecs服务器挂载oss

           

一、

wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.7_ubuntu20.04_amd64.deb

sudo gdebi ossfs_1.80.7_ubuntu20.04_amd64.deb

二、

echo BucketName:yourAccessKeyId:yourAccessKeySecret > /etc/passwd-ossfs

三、

chmod 640 /etc/passwd-ossfs

四、

mkdir /mnt/oss

#mkdir /www/wwwroot/pack 空目录

五、

ossfs xtao /www/wwwroot/pack/apk -o url=http://oss-cn-shenzhen-internal.aliyuncs.com

#ossfs xtao /www/wwwroot/pack/apk -o url=http://oss-cn-shenzhen-internal.aliyuncs.com

六、开机自启动

cd /etc/init.d/

vim ossfs

#! /bin/bash
chkconfig: 2345 10 90
description: Auto mount ossfs
ossfs xtao /www/wwwroot/pack/apk -o url=http://oss-cn-shenzhen-internal.aliyuncs.com -o allow_other

chkconfig ossfs on 可能

#sudo sysv-rc-conf xxxx on

ps aux | grep ossfs

资料查阅:

如何安装ossfs_对象存储-阿里帮助中心

Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-90-generic x86_64)