Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >bindfs - Mount a directory elsewhere with changed permissions.

bindfs - Mount a directory elsewhere with changed permissions.

作者头像
西湖醋鱼
发布于 2021-12-14 11:36:28
发布于 2021-12-14 11:36:28
85900
代码可运行
举报
运行总次数:0
代码可运行

今天阅读fanstore论文时,发现其使用bindfs做了实验;我个人对filesystem比较感兴趣,进行初步使用一下并进行记录;

项目地址:https://github.com/mpartel/bindfs

项目网站:https://bindfs.org/

项目功能:使用不同的权限,重新在本机挂载一个文件系统

原理:使用libfuse实现的stackfs; 其中做了属性的控制;

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
bindfs is a FUSE filesystem for mirroring a directory to another directory, similarly to mount --bind. 
The permissions of the mirrored directory can be altered in various ways.

Some things bindfs can be used for:

  1. Making a directory read-only.
  2. Making all executables non-executable.
  3. Sharing a directory with a list of users (or groups).
  4. Modifying permission bits using rules with chmod-like syntax.
  5. Changing the permissions with which files are created.
  6. Non-root users can use almost all features, but most interesting use-cases need user_allow_other to be defined in /etc/fuse.conf.

如果允许非root用户使用,需要设置:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Non-root users can use almost all features, but most interesting use-cases need user_allow_other to be defined in /etc/fuse.conf.

测试结果:

使用 bindfs 可以达到和 mount --bind 同样的效果,并且多了权限控制的功能;但是从性能上来说,因为bindfs为用户态文件系统,所以bindfs的性能会低于mount --bind的方式。

具体性能对比测试,我这里没有进行,你可以简单使用工具进行对比;

常用命令:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Make a directory read-only for non-root users.
bindfs --perms=a-w somedir somedir

Share a directory with some other users without modifying /etc/group.
bindfs --mirror-only=joe,bob,@wheel ~/some/dir shared

Make all new files uploaded to an FTP share owned by you and seen by everyone.
bindfs --create-for-user=me --create-with-perms=u+rw,a+rD /var/ftp/uploads /var/ftp/uploads

Make your website available to the webserver process read-only.
bindfs --force-user=www --perms=0000:u=rD ~/stuff/website ~/public_html

The corresponding /etc/fstab entry.
/home/bob/stuff/website /home/bob/public_html fuse.bindfs force-user=www,perms=0000:u+rD 0 0

保持更新;cnblogs.com/xuyaowen;

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-12-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
linux 命令中英文对照,收集
听说markdown排版得用浏览器打开,点击最下面的阅读原文也可以! Is Linux CLI case-sensitive? The answer is, yes. If you try to ru
生信技能树
2018/03/05
2.2K0
【Linux】《how linux work》第二章 基本命令和目录层次结构(3)
Every Unix file has a set of permissions that determine whether you can read, write, or run the file. Running ls -l displays the permissions. Here’s an example of such a display:
阿东
2024/04/27
1210
【Linux】《how linux work》第二章 基本命令和目录层次结构(3)
一天一个 Linux 命令(31):mount 命令
本文为joshua317原创文章,转载请注明:转载自joshua317博客 https://www.joshua317.com/article/174
joshua317
2021/10/25
1K0
Ubutu/Debian使用 VSFTPD架设FTP服务器小结
架设FTP服务器有好几次了,以前搭建好以后,没有记录操作的详细步骤,过阵时间又忘记了。此次架设FTP服务的需求要点: vsftpd mysql 虚拟用户 虚拟目录 只读用户 只写用户 读写用户。
全栈程序员站长
2022/09/14
2.3K0
【Linux】《how linux work》第二章 基本命令和目录层次结构(第二部分)
Occasionally, you may redirect standard output but find that the program still prints something to the terminal. This is called standard error (stderr); it’s an additional output stream for diagnostics and debugging.
阿东
2024/04/21
1480
【Linux】《how linux work》第二章 基本命令和目录层次结构(第二部分)
《Android外部存储》
| 导语 外部存储作为开发中经常接触的一个重要系统组成,在Android历代版本中,有过许许多多重要的变更。我也曾疑惑过,为什么一个简简单单外部存储,会存在存在这么多奇奇怪怪的路径:/sdcard、/mnt/sdacrd、/storage/extSdCard、/mnt/shell/emulated/0、/storage/emulated/0、/mnt/shell/runtime/default/emulated/0…其实,这背后代表了一项项技术的成熟与发布:模拟外部存储、多用户、运行时权限… 一、各版本外部
腾讯Bugly
2018/03/23
2.7K0
Why does FUSE on Android suck?
Introduction FUSE (Filesystem in Userspace) is a very useful mechanism in many applications. The thing is, those applications should not be focused on performance in terms of actual data transfers. FUSE has many advantages implied by userspace sandboxing, but for sure performance wasn't the main design consideration. I'm not telling that it is a bad design or something wrong with FUSE itself. It is just focused on other aspects like security, stability and easiness of creating applications. The problem I'd like to discuss here is that Google decided to use FUSE as a frontend to actual data stored on the non-volatile memory. FUSE has been introduced in Android 4.4 to handle "emulated" storage. Before that, "emulated" storage path was mounted as VFAT. Here's how it looked on old ICS (output of mount command):
用户9732312
2022/05/13
1K0
Help - hack the box
To be honest, Help is not a difficult box. But there are some rabbit holes in the box. And in some case, you may come across some very strange situations. May you should step back, find if there is something wrong. For the PrivEsc of root, never give up trying the most basic method.
madneal
2019/11/28
1.2K0
Mount NTFS Partitions
Windows uses a different filesystem (NTFS) to store files. In order for Fedora to read that filesystem, you require NTFS support in your kernel. You can either recompile your kernel for NTFS read support -OR- obtain the proper kernel module.
全栈程序员站长
2022/09/07
2.8K0
搭建Ubuntu12.04交叉编译服务器
最近学着搭建一台Linux服务器作为交叉编译的主机之用,服务器端选择了Ubuntu12.04 LTS桌面版,客户端采用Windows XP平台,使用SSH工具软件putty登录到Linux主机,建立scrathbox2交叉编译环境工具链,模拟arm环境。
ccf19881030
2019/04/24
1.3K0
hadoop-core-site.xml配置文件详解
hadoop配置文件:core-site.xml详解 core-site.xml配置文件介绍 HDFS和MapReduce常用的I/O设置等 core-site.xml配置文件 Hadoop2.0版本的core-site.xml name description value hadoop.tmp.dir A base for other temporary directories. 只可以设置一个值;建议设置到一个足够空间的地方,而不是默认的/tmp下 服务端参数,修改需重启 /tmp/hadoop-
许喜朝
2020/10/27
2.4K0
linux kernel Documentation filesystems overlayfs
Please see MAINTAINERS file for where to send questions.
heidsoft
2019/01/23
2.3K0
【神兵利器】红队Active Directory侦察利用工具
SharpADWS 是一个为 Red Teams 打造的 Active Directory 侦查和利用工具,其通过 Active Directory Web Services (ADWS) 协议收集并修改 Active Directory 数据。
Al1ex
2025/01/07
1180
【神兵利器】红队Active Directory侦察利用工具
使用littlefs-fuse在PC端调试littlefs文件系统
littlefs是arm面向嵌入式设备推出的一款掉电安全的小型文件系统,具有抗掉电,动态磨损均衡,RAM/ROM需求少等特点,具体介绍可见 https://github.com/ARMmbed/littlefs
zqb_all
2019/12/27
2.8K0
Linux之rsync数据同步服务
  rsync是一个开源、快速的、多动能的、可以实现全量,增量的本地或远程数据同步备份工具,它适用于多种操作系统平台。
用户1173509
2022/05/09
5.1K0
Linux之rsync数据同步服务
ubuntu 16.04 搭建ftp服务器
如果登录后出现如下错误,则在/etc/vsftpd.conf文件内添加allow_writeable_chroot=YES
全栈程序员站长
2022/09/14
1.6K0
perl dancer 基础4
安装Expect模块 配置cpan 首先要配置cpan [root@dancer-test ~]# perl -MCPAN -e shell Sorry, we have to rerun the configuration dialog for CPAN.pm due to some missing parameters... The following questions are intended to help you with the configuration. The CPAN modu
franket
2022/03/25
3940
在Ubuntu中安装Samba文件服务
在Ubuntu中安装Samba文件服务安装 samba 服务root@v:~# apt install samba samba-commonroot@v:~# 创建共享目录root@v:~# mkdir /cby/smb/ -pvroot@v:~# chmod 777 -R /cby/smb/root@v:~# 修改配置文件# 编写配置文件 实现匿名访问[share]path = /cby/smbpublic = yesread only = noguest ok = Yescreate mask = 06
小陈运维
2022/11/09
1.8K0
KVM/QEMU hypervisor driver
The libvirt KVM/QEMU driver can manage any QEMU emulator from version 0.12.0 or later.
战神伽罗
2019/07/24
1.3K0
Ubuntu 14.04 下FTP服务器的搭建
Ubuntu 14.04 下FTP服务器的搭建--锁定用户目录,解决vsftpd: refusing to run with writable root inside chroot()
星哥玩云
2022/07/04
1.1K0
相关推荐
linux 命令中英文对照,收集
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验