Women in Technology

Hear us Roar



Article:
  Securing Systems with chroot
Subject:   Typical Problem
Date:   2003-02-04 03:42:53
From:   anonymous2
Hi,
after reading this article I tried to chroot in a directory named /test. /test/bin/sh existed but chroot said "/bin/sh: No such file or directory".
The article says, that you have to cp some libraries to /test/lib/ but how you can find out which libs to cp it doesn't tell.


The solution to this problem, into which you may also run, is to do a "ldd /test/bin/sh" and cp the resulting libraries to /test/lib/.

Main Topics Newest First

Showing messages 1 through 2 of 2.

  • Re: Typical Problem
    2003-02-10 07:04:48  anonymous2 [View]

    The command must be relative to the new root, ex:
    mkdir /tmp/test /tmp/test/bin
    cp /bin/sh /tmp/test/bin/
    chroot /tmp/test bin/sh
    or
    chroot /tmp/test /bin/sh
    not
    chroot /tmp/test /tmp/test/bin/sh

    assumed that sh is statically linked( it's in the root partition)
  • Less Typical Problem
    2003-10-19 16:17:25  anonymous2 [View]

    if you still have this error message after adding the libs run:

    cp /etc/ld.so.conf /test/etc
    ldconfig -r /test