Skip to content

Instantly share code, notes, and snippets.

@mizzy
Created December 2, 2011 13:19
Show Gist options
  • Select an option

  • Save mizzy/1423219 to your computer and use it in GitHub Desktop.

Select an option

Save mizzy/1423219 to your computer and use it in GitHub Desktop.
Easy chroot script
#!/bin/sh
mkdir -p /var/root
for i in bin dev etc lib lib64 tmp usr var
do
mkdir /var/root/$i
mount -o bind /$i /var/root/$i
done
mkdir -p /var/root/home/mizzy
mount -o bind /home/mizzy /var/root/home/mizzy
chroot --userspec=mizzy:mizzy /var/root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment