[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: chroot: cannot run command `/bin/bash': No such file or directory



On Mon, Aug 20, 2007 at 10:33:20PM +0200, Gerard Robin wrote:
> On Mon, Aug 20, 2007 at 02:44:31PM -0400, Neil Watson wrote:
>> On Mon, Aug 20, 2007 at 08:40:09PM +0200, Gerard Robin wrote:
>>>> First post:
>>>>> ldd  /bin/bash
>>>>>          libncurses.so.5 => /lib/libncurses.so.5 (0x00002b2d9014f000)
>>>>>          libdl.so.2 => /lib/libdl.so.2 (0x00002b2d9039b000)
>>>>>          libc.so.6 => /lib/libc.so.6 (0x00002b2d9059f000)
>>>>>          /lib64/ld-linux-x86-64.so.2 (0x00002b2d8ff31000)
>>>>
>>>> I don't see the last entry in the results of the find command.
>>> yes but it's a symbolic link to ld-2.6.1.so:
>>>
>>> ls -la /lib64/ld-linux-x86-64.so.2 :
>>> lrwxrwxrwx 1 root root 11 2007-08-07 23:08 /lib64/ld-linux-x86-64.so.2 -> 
>>> ld-2.6.1.so*
>>
>> I doubt the process would know that.  It may look for the link name and
>> fail if it is not found.  Create the link in your jail and try again.
>
> ok, now I have:
> ls -l /f:
> drwxr-xr-x 2 root root  72 2007-08-20 20:10 bin/
> drwxr-xr-x 2 root root 216 2007-08-20 22:07 lib/
> lrwxrwxrwx 1 root root   6 2007-08-20 22:00 lib64 -> /f/lib/

Seems to me that symlink target ought to be lib/ or /lib/, since /f/lib/
won't be visible when you chroot to /f/.

Ken

> ls -l /f/lib:
> -rwxr-xr-x 1 root root 121K 2007-08-20 15:50 ld-2.6.1.so*
> lrwxrwxrwx 1 root root   11 2007-08-20 22:07 ld-linux-x86-64.so.2 -> 
> ld-2.6.1.so*
> -rwxr-xr-x 1 root root 1,4M 2007-08-20 15:50 libc.so.6*
> -rw-r--r-- 1 root root  15K 2007-08-20 15:50 libdl.so.2
> -rw-r--r-- 1 root root 304K 2007-08-20 15:50 libncurses.so.5
>
> and always:
>
> chroot /f:
> chroot: cannot run command `/bin/bash': No such file or directory

-- 
Ken Irving, fnkci+debianuser@uaf.edu



Reply to: