Is it possible let chroot jails share directories(read-only) outside the jail? Is it possible let chroot jails share directories(read-only) outside the jail? linux linux

Is it possible let chroot jails share directories(read-only) outside the jail?


You can use the new bind mounts support to make identical directory structures available through multiple paths.

mount --bind /usr/bin /path/to/chroot/jail/usr/binmount -o remount,ro /path/to/chroot/jail/usr/bin

For more details, see mount(8).

You can get really clever with mounting on Linux systems these days; for more details, see the Linux kernel source file Documentation/filesystems/sharedsubtree.txt.