Linux/chroot

From Omnia
Jump to navigation Jump to search

bind

mount --bind /proc <chroot dir>/proc
mount -t proc none /proc

linux - mount dev, proc, sys in a chroot environment? - Super User - https://superuser.com/questions/165116/mount-dev-proc-sys-in-a-chroot-environment

chroot

NOTE: chroot only runs as root!

Find what libraries bash needs and copy these to the lib folder

ldd /bin/bash

Example: [1]

mkdir chroot
cd chroot
mkdir {bin,dev,lib}
cp -p /bin/bash bin/
cp -p /lib/{ld-linux.so.2,libc.so.6,libdl.so.2} lib/
mknod dev/null c 1 3
mknod dev/zero c 1 5
chmod 0666 dev/{null,zero}
cd ..
chroot chroot

issues

keywords