newbie chroot problem - restated - Redhat

This is a discussion on newbie chroot problem - restated - Redhat ; Using CentOS 4.1 (RHEL equivalent) as root with bash as my shell, I reviewed the man pages and info for chroot, did ldd for /bin/bash, and got the following: # ldd /bin/bash libtermcap.so.2 => /lib/libtermcap.so.2 (0x00d77000) libdl.so.2 => /lib/libdl.so.2 (0x00c98000) ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: newbie chroot problem - restated

  1. newbie chroot problem - restated

    Using CentOS 4.1 (RHEL equivalent) as root with bash as my shell, I
    reviewed the man pages and info for chroot, did ldd for /bin/bash, and
    got the following:

    # ldd /bin/bash
    libtermcap.so.2 => /lib/libtermcap.so.2 (0x00d77000)
    libdl.so.2 => /lib/libdl.so.2 (0x00c98000)
    libc.so.6 => /lib/tls/libc.so.6 (0x00b48000)
    /lib/ld-linux.so.2 (0x00b2f000)
    [root@localhost /]#

    So I then created the following directory setup:

    # ls -Ral /crtest
    /crtest:
    total 32
    drwxr-xr-x 4 root root 4096 Aug 18 12:22 .
    drwxr-xr-x 26 root root 4096 Aug 18 14:03 ..
    drwxr-xr-x 2 root root 4096 Aug 18 12:23 bin
    drwxr-xr-x 3 root root 4096 Aug 17 17:15 lib

    /crtest/bin:
    total 780
    drwxr-xr-x 2 root root 4096 Aug 18 12:23 .
    drwxr-xr-x 4 root root 4096 Aug 18 12:22 ..
    -rwxr-xr-x 1 root root 772760 Feb 17 20:30 bash

    /crtest/lib:
    total 168
    drwxr-xr-x 3 root root 4096 Aug 17 17:15 .
    drwxr-xr-x 4 root root 4096 Aug 18 12:22 ..
    -rwxr-xr-x 1 root root 93256 Jun 9 20:40 ld-2.3.4.so
    lrwxrwxrwx 1 root root 11 Aug 18 12:48 ld-linux.so.2 -> ld-2.3.4.so
    -rwxr-xr-x 1 root root 11168 Jun 9 20:40 libdl-2.3.4.so
    lrwxrwxrwx 1 root root 14 Aug 18 12:48 libdl.so.2 -> libdl-2.3.4.so
    lrwxrwxrwx 1 root root 19 Aug 18 12:48 libtermcap.so.2 ->
    libtermcap.so.2.0.8
    -rwxr-xr-x 1 root root 10884 Feb 21 14:55 libtermcap.so.2.0.8
    drwxr-xr-x 2 root root 4096 Aug 17 17:10 tls

    /crtest/lib/tls:
    total 1216
    drwxr-xr-x 2 root root 4096 Aug 17 17:10 .
    drwxr-xr-x 3 root root 4096 Aug 17 17:15 ..
    -rwxr-xr-x 1 root root 1212936 Jun 9 20:40 libc-2.3.4.so
    lrwxrwxrwx 1 root root 13 Aug 18 12:48 libc.so.6 -> libc-2.3.4.so
    [root@localhost /]# ls -Ral /crtest
    /crtest:
    total 32
    drwxr-xr-x 4 root root 4096 Aug 18 12:22 .
    drwxr-xr-x 26 root root 4096 Aug 18 14:03 ..
    drwxr-xr-x 2 root root 4096 Aug 18 12:23 bin
    drwxr-xr-x 3 root root 4096 Aug 17 17:15 lib

    /crtest/bin:
    total 780
    drwxr-xr-x 2 root root 4096 Aug 18 12:23 .
    drwxr-xr-x 4 root root 4096 Aug 18 12:22 ..
    -rwxr-xr-x 1 root root 772760 Feb 17 20:30 bash

    /crtest/lib:
    total 168
    drwxr-xr-x 3 root root 4096 Aug 17 17:15 .
    drwxr-xr-x 4 root root 4096 Aug 18 12:22 ..
    -rwxr-xr-x 1 root root 93256 Jun 9 20:40 ld-2.3.4.so
    lrwxrwxrwx 1 root root 11 Aug 18 12:48 ld-linux.so.2 -> ld-2.3.4.so
    -rwxr-xr-x 1 root root 11168 Jun 9 20:40 libdl-2.3.4.so
    lrwxrwxrwx 1 root root 14 Aug 18 12:48 libdl.so.2 -> libdl-2.3.4.so
    lrwxrwxrwx 1 root root 19 Aug 18 12:48 libtermcap.so.2 ->
    libtermcap.so.2.0.8
    -rwxr-xr-x 1 root root 10884 Feb 21 14:55 libtermcap.so.2.0.8
    drwxr-xr-x 2 root root 4096 Aug 17 17:10 tls

    /crtest/lib/tls:
    total 1216
    drwxr-xr-x 2 root root 4096 Aug 17 17:10 .
    drwxr-xr-x 3 root root 4096 Aug 17 17:15 ..
    -rwxr-xr-x 1 root root 1212936 Jun 9 20:40 libc-2.3.4.so
    lrwxrwxrwx 1 root root 13 Aug 18 12:48 libc.so.6 -> libc-2.3.4.so
    [root@localhost /]#
    [root@localhost /]#

    Then, when I try chroot /crtest I get:

    # chroot /crtest
    chroot: cannot run command `/bin/bash': No such file or directory
    [root@localhost /]#

    Obviously, I am missing something here.

    Any help appreciated.

    Thanks

    Apollo

  2. Re: newbie chroot problem - restated - and solved


    > Then, when I try chroot /crtest I get:
    >
    > # chroot /crtest
    > chroot: cannot run command `/bin/bash': No such file or directory
    > [root@localhost /]#
    >
    > Obviously, I am missing something here.
    >
    > Any help appreciated.
    >
    > Thanks
    >
    > Apollo


    Having an off day.

    I was bouncing back and forth between 64 and 32 bit boxes. Apparently
    used ldd info from one box and made corresponding changes on other box.
    Did not work so good.

    Sorry for the misinfo everyone.

    Thanks

    Apollo

+ Reply to Thread