Chroot

From UVOO Tech Wiki
Jump to navigation Jump to search

Using chroot

/bin/bash depends of course on libc, ld-linux, libdl etc., you can use ldd /bin/bash to see which libraries it requires.

1) You can mount -o bind these directories under chroot 2) Or you can copy these libraries to chroot, if you don't trust the chrooted env to not corrupt them, like so:

cp main rootfs/
cp -a /usr rootfs/
cp -a /lib rootfs/
cp -a /lib64 rootfs/

chmod rootfs

chroot --userspec=test1:test1 ./rootfs /main

Ref