Github:https://github.com/aliyun/ossfs/wiki
Root账户卸载:umount /挂载目录
非root用户要卸载目录,请用:fusermount -u your_mountpoint
前提:挂载目录test1,账户www,无登录权限,挂载bucket:dcces
Which ossfs获取ossfs的安装路径,因为普通账户没有相关权限。
Root账户登录。
1、id www ,获取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 -R www:root /etc/passwd-ossfs
5、进行挂载
ossfs dcces test1 -ourl=https://oss-cn-hangzhou.aliyuncs.com -oallow_other -omp_umask=007 -ouid=504 -ogid=0 -odefault_permission=750
说明:
url为bucket的Endpoint;
mp_umask为option的取值;
passwd_file=ttpasswd-ossfs为passwd-ossfs 文件的路径
官方FAQ参考:https://github.com/aliyun/ossfs/wiki/FAQ
常见配置问题:
以下问题出现在非root用户下
ossfs: credentials file /etc/passwd-ossfs should not have others permissions. should not have group permissions
# sudo chmod 640 /etc/passwd-ossfs
原文:https://www.cnblogs.com/wjoyxt/p/10769970.html