[linux-help] Re: 'chroot' help.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, 20 May 2000, Wang Min wrote:
> I am testing the chroot function, I think 'man chroot' talking
> about nothing, I test the following commands 'chroot /tmp
> /bin/sh', the error is 'chroot: cannot execute /bin/sh: No
> such file or directory', as a matter of fact, there is bin,
> sbin, usr, usr/sbin...sub-directory in /tmp, and there are the
> appropriate files in the directories, what should I do to
> implement chroot?
You've got a good start, but since /bin/sh (probably /bin/bash) is
dynamically linked, you need it's libraries:
$ ldd /bin/sh
libtermcap.so.2 => /lib/libtermcap.so.2 (0x40019000)
libc.so.6 => /lib/libc.so.6 (0x4001d000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
$ mkdir -p /tmp/usr/lib /tmp/lib /tmp/sbin /tmp/etc
$ cp /lib/libtermcap.so.2 /lib/libc.so.6 /lib/ld-linux.so.2 /tmp/lib
$ cp /sbin/ldconfig /tmp/sbin
$ sudo /usr/sbin/chroot /tmp /sbin/ldconfig
$ sudo /usr/sbin/chroot /tmp /bin/sh
bash#
-jeff
--
What do you think about these so-called anti-homelessness laws? "I don't think
them as anti-homelessness laws. I think of them as pro-homeowner laws." Thomas
Canby, Ceramic Engineer. http://www.theonion.com/onion3547/wdyt_3547.html
-- This is the linux-help@xxxxxxxxx list. To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
|
|