【发布时间】:2019-08-26 17:27:02
【问题描述】:
我正在我的机器上运行一个虚拟机,并使用 sshfs(通过 fstab 自动安装)在虚拟机内安装了一个主机文件夹。
abc@xyz:/home/machine/test on /home/vm/test type fuse.sshfs (rw,relatime,user_id=0,group_id=0,allow_other)
那个文件夹有一个我想在虚拟机中运行的可执行文件。但在运行该可执行文件之前,我还需要一些功能。所以我的脚本看起来像:
#!/bin/bash
# Some preprocessing.
sudo setcap CAP_DAC_OVERRIDE+ep /home/vm/test/my_exec
/home/vm/test/my_exec
但我得到以下错误:
Failed to set capabilities on file `/home/vm/test/my_exec' (Operation not supported)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
但是,如果我在 VM 中复制可执行文件(例如在 /tmp/ 中),那么它工作得非常好。这是 sshfs 的已知限制还是我在这里遗漏了什么?
【问题讨论】:
标签: linux virtual-machine sshfs linux-capabilities