mkjail
mkjail copied to clipboard
Does not work with the latest High Sierra (10.13.6)
Multiple issues:
- The script fails to enter the jail because /bin/sh is missing.
- Running
/bin/bash
inside the jail results in missing library errors. - The required library depends on a lot of extra libraries.
This project seems to be inactive. If anyone here wants to create a macOS jail, have a look at my project. The main difference is the utilities are by GNU and they are compiled by the script instead of copying them from the system, thus they are up to date, while macOS comes with old BSD versions of these utilities.
Adding a couple lines into the mkjail.files worked for me on mojave:
index 974ae47..615da98 100644
--- a/mkjail.files
+++ b/mkjail.files
@@ -1,4 +1,5 @@
/bin/bash
+/bin/sh
/dev/null
/dev/urandom
/dev/zero
@@ -28,6 +29,7 @@
/usr/lib/system/libsystem_configuration.dylib
/usr/lib/system/libsystem_coreservices.dylib
/usr/lib/system/libsystem_coretls.dylib
+/usr/lib/system/libsystem_darwin.dylib
/usr/lib/system/libsystem_dnssd.dylib
/usr/lib/system/libsystem_info.dylib
/usr/lib/system/libsystem_kernel.dylib
@@ -41,6 +43,7 @@
/usr/lib/system/libsystem_sandbox.dylib
/usr/lib/system/libsystem_secinit.dylib
/usr/lib/system/libsystem_stats.dylib
+/usr/lib/system/libsystem_symptoms.dylib
/usr/lib/system/libsystem_trace.dylib
/usr/lib/system/libunc.dylib
/usr/lib/system/libunwind.dylib```
After running mkjail you can select either /bin/sh or /bin/bash with $SHELL:
TT-MBP-2016:~ root# export SHELL=/bin/bash
TT-MBP-2016:~ root# chroot /jail/test/
bash-3.2#
TT-MBP-2016:~ root# export SHELL=/bin/sh
TT-MBP-2016:~ root# chroot /jail/test/
sh-3.2#
Hi. Honestly, I no longer have the time or inclination to work on this project. I am happy to accept PRs, or redirect people towards something better.