小编Sli*_*red的帖子

防止写入未挂载的 sshfs 挂载点

假设我有一个文件夹/mnt/mountpoint用作某些sshfs-mounted 目录的挂载点:

sshfs user@host /mnt/mountpoint
Run Code Online (Sandbox Code Playgroud)

现在,我想阻止应用程序在/mnt/mountpoint卸载时写入。我在这里这里找到的问题的答案暗示使用

sudo chattr +i /mnt/mountpoint
Run Code Online (Sandbox Code Playgroud)

这可以很好地防止任何写访问。不幸的是,它也阻止了我sshfs作为普通用户安装。

什么是最好的解决方案?我更喜欢单个 sshfs-command 或至少不需要 root 权限的东西。我应该放弃这种chattr方法并尝试完全不同的方法吗?

linux mount sshfs

5
推荐指数
1
解决办法
640
查看次数

标签 统计

linux ×1

mount ×1

sshfs ×1