BSD 监狱中的用户完全访问托管系统上特定用户文件的最佳方式
这恰好是一个 TrueNAS (BSD) 系统。系统本身的 ID 为 pedz
,UID 为 1000。(我称他为 Gpedz)。我创建了一个监狱,这样我就可以编写一个应用程序并在 NAS 上安全地运行它,并在监狱内创建了一个 pedz
用户,该用户的 UID 为 1002。我称他为 Jpedz。
该应用程序将作为 Jpedz 运行,但需要访问 Gpedz 拥有的文件,包括删除文件的能力。
我可以编辑监狱中的 /etc/passwd 文件并将 Jpedz UID 设为 1000,我打赌这会解决我的问题,但我想知道是否有更可接受的方法来解决此问题。
This happens to be a TrueNAS (BSD) system. The system itself has an id of pedz
with UID of 1000. (I'll call him Gpedz). I created a jail so I could write an application and run it safely on the NAS and created a user of pedz
within the jail which was given a UID of 1002. I'll call him Jpedz.
The application will be running as Jpedz but will need access to the files owned Gpedz including the ability to remove files.
I could edit the /etc/passwd file in the jail and make the Jpedz UID 1000 and I bet that would solve my problem but I'm wondering if there is a more accepted way to solve this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该按预期工作:
确保它们的主目录是 zfs 文件系统:
<代码>/usr/home/pedz
将类似内容添加到监狱 rc.conf 文件中:
jail_pedz_mount_enable="YES"
将其添加到监狱 /etc/fstab:
/usr/home/pedz /jails/j1/usr/ports nullfs rw,noatime 0 0
This should work as expected:
Make sure their home directory is a zfs filesystem:
/usr/home/pedz
Add something like this to the jail rc.conf file:
jail_pedz_mount_enable="YES"
Add this to the jail /etc/fstab:
/usr/home/pedz /jails/j1/usr/ports nullfs rw,noatime 0 0