Skip to content

Commit a9485d1

Browse files
author
Jan Sarenik
committed
Update for macOS Mojave
1 parent 2fb5ce3 commit a9485d1

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

README

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
Scripts to make a working chroot on Mac OS X.
2-
It currently works with El Captain (10.11).
3-
Note that ping will end with following message in `dmesg`:
1+
Scripts to make a working chroot on macOS.
2+
It currently works with `macOS Mojave (10.14.5)`.
43

5-
AMFI: hook..execve() killing pid #: not allowed in chroot
6-
7-
$ uname -a
8-
Darwin lomidrevo.local 15.0.0 Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64 i386 MacBookPro9,2 Darwin
4+
```
5+
mac-jail$ uname -a
6+
Darwin my-funny-hostname.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
7+
```
98

109
USAGE
1110
=====
1211

1312
./mkmacchroot.sh [directory]
1413

15-
If the directory is not specified, then $PWD/mac-jail will be used.
14+
If the directory is not specified, then `$PWD/mac-jail` will be used.
1615

1716
sudo ./chroot.sh [directory]
1817

chroot.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ ln -f $SSH_AUTH_SOCK $JAILSOCK
3232
env -i \
3333
TERM=$TERM \
3434
PS1="${MACJAIL##*/}\$ " \
35+
SSH_AUTH_SOCK=$SSH_AUTH_SOCK \
3536
SHELL=$SHELL \
3637
HOME=$HOME \
3738
PATH=$PATH \

mkmacchroot.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@ MACJAIL=${1:-"$PWD/mac-jail"}
44

55
{
66
cat <<EOF
7-
/usr/lib/dyld
87
/bin/bash
9-
/bin/ls
108
/bin/cat
11-
/bin/rm
9+
/bin/ls
1210
/bin/mkdir
13-
/bin/rmdir
1411
/bin/mv
12+
/bin/rm
13+
/bin/rmdir
14+
/bin/sh
1515
/bin/sleep
1616
/sbin/ping
17-
/usr/bin/vi
18-
/usr/bin/grep
19-
/usr/bin/less
17+
/usr/bin/curl
18+
/usr/bin/dig
2019
/usr/bin/env
20+
/usr/bin/grep
2121
/usr/bin/host
22-
/usr/bin/dig
23-
/usr/bin/curl
22+
/usr/bin/id
23+
/usr/bin/less
2424
/usr/bin/ssh
25+
/usr/bin/ssh-add
26+
/usr/bin/uname
27+
/usr/bin/vi
28+
/usr/lib/dyld
2529
/usr/sbin/netstat
26-
/usr/local/bin/mksh
2730
EOF
2831
} | while read bin
2932
do

0 commit comments

Comments
 (0)