BSD 监狱中的用户完全访问托管系统上特定用户文件的最佳方式

发布于 2025-01-16 18:49:43 字数 322 浏览 1 评论 0原文

这恰好是一个 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡の花香 2025-01-23 18:49:43

这应该按预期工作:

  • 确保它们的主目录是 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文