Skip to content

Instantly share code, notes, and snippets.

@moycat
Created November 11, 2020 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moycat/76f2c6a54e38e29ca75789e73efafee0 to your computer and use it in GitHub Desktop.
Save moycat/76f2c6a54e38e29ca75789e73efafee0 to your computer and use it in GitHub Desktop.
UnionFS Sandbox
# run as root
# create
mkdir -p /tmp/union/root /tmp/union/tmp
unionfs-fuse -o cow,dev,suid,allow_other /tmp/union/tmp=RW:/=RO /tmp/union/root
mount --bind /dev /tmp/union/root/dev
mount --bind /sys /tmp/union/root/sys
mount --bind /proc /tmp/union/root/proc
# enter
chroot /tmp/union/root
# destroy
umount /tmp/union/root/dev /tmp/union/root/sys /tmp/union/root/proc
umount /tmp/union/root
rm -rf /tmp/union
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment