首页 技术 正文
技术 2022年11月14日
0 收藏 467 点赞 3,522 浏览 1394 个字

Github下载:https://github.com/aliyun/ossfs/wiki

# https://github.com/aliyun/ossfs/releases/download/v1.80.5/ossfs_1.80.5_centos7.0_x86_64.rpm
# yum localinstall ossfs_1..5_centos7.0_x86_64.rpm

Root账户卸载:umount /挂载目录
非root用户要卸载目录,请用:fusermount -u your_mountpoint

前提:挂载目录test1,账户www,无登录权限,挂载bucket:mybucket
Root账户登录。

1、# id www ->504 ,获取uid、gid

2、root账户或者其他账户创建挂载目录 ,然后修改目录属主:chown -R www:root test1

3、echo yiruike-logs:KTAIdXjNEnfEaIHW:8QsUJKGaVOIJFvi11UlbSiZk5vTfhR >> /etc/passwd-ossfs

4、修改配置文件权限:         chmod 600 /etc/passwd-ossfs
     修改配置文件属主、属组:chown www:root /etc/passwd-ossfs

5、进行挂载

ossfs mybucket test1 -ourl=https://oss-cn-hangzhou.aliyuncs.com -oallow_other -omp_umask=007 -ouid= -ogid=0 -odefault_permission=750

说明:

url为bucket的Endpoint;
           mp_umask为option的取值;
           passwd_file=ttpasswd-ossfs为passwd-ossfs 文件的路径

如果只给除root用户以外的用户只读权限的放,只加-oallow_other即可。

卸载:

# fuser -vm /tmp/myoss

官方FAQ参考:https://github.com/aliyun/ossfs/wiki/FAQ

常见配置问题:

以下问题出现在非root用户下

执行echo ××××> /etc/passwd-ossfs  bash: /etc/passwd-ossfs: Permission denied使用sudo vim 在/etc下新建就可以,将echo等内容拷贝进去 

ossfs: credentials file /etc/passwd-ossfs should not have others permissions. should not have group permissions
# sudo chmod 640 /etc/passwd-ossfs

could not determine how to establish security credentials
是因为没有找到passwd-ossfs文件,如果在/etc/passwd-ossfs文件已经存在,把它的所有者改成当前用户如www:
# sudo chown www /etc/passwd-ossfs

  配置其他路径passwd-ossfs文件ossfs my-bucket  my-mount-point -ourl=my-oss-endpoint  -opasswd_file=/home/work/passwd-ossfs   

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,088
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,564
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,413
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,186
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,822
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,905