下载ossfs

wget https://github.com/aliyun/ossfs/releases/download/v1.80.2/ossfs_1.80.2_ubuntu16.04_amd64.deb

安装deb文件

apt-get install -y gdebi-core
gdebi ossfs_1.80.2_ubuntu16.04_amd64.deb

安装完成后,需要配置OSS使用的帐号信息

vim /etc/passwd-ossfs
innova:IUNzEqNx:o7CgFef15Kgbs60dL9v
#bucket名字:access-key:access-secret

chmod 640 /etc/passwd-ossfs

通过ossfs将阿里云oss挂在到本地

ossfs my-bucket my-mount-point -ourl=my-oss-endpoint
        bucket名字   要挂到本地的目录   oss里bucket的地域节点(url地址)

ossfs挂载oss到ECS本地并设置权限

取消挂载

umount 本地目录

挂载时设置权限

ossfs my-bucket my-mount-point -ourl=my-oss-endpoint  -o umask=022 或-o allow_other

-o umask 指定umask权限码 022对应的权限为755

-o allow_other 权限为所有 777

 

相关文章:

  • 2021-12-02
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2021-08-21
猜你喜欢
  • 2021-09-08
  • 2021-04-24
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-06-17
相关资源
相似解决方案