PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > chroot: cannot run command `/bin/bash': No such file or directory
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

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

Réponse
 
LinkBack Outils de la discussion
Vieux 20/08/2007, 20h00   #1
Gerard Robin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut chroot: cannot run command `/bin/bash': No such file or directory

Hello,
I have a problem to use chroot:
I did:
sudo -s
mkdir /f
mkdir /f/bin /f/lib
cp /bin/bash /f/bin

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)

cp /lib/libncurses.so.5 /lib/libdl.so.2 /lib/libc.so.6 /lib/ld-2.6.1.so /f/lib

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

What is wrong in my approach ?

tia
--
Gérard
  Réponse avec citation
Vieux 20/08/2007, 20h10   #2
Neil Watson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chroot: cannot run command `/bin/bash': No such file or directory

What does 'find /f' produce?

--
Neil Watson | Debian Linux
System Administrator | Uptime 2 days
http://watson-wilson.ca


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 20/08/2007, 20h20   #3
Gerard Robin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chroot: cannot run command `/bin/bash': No such file or directory

On Mon, Aug 20, 2007 at 02:01:07PM -0400, Neil Watson wrote:
>From: Neil Watson <debian@watson-wilson.ca>
>To: debian-user@lists.debian.org
>Subject: Re: chroot: cannot run command `/bin/bash': No such file or directory
>X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on murphy.debian.org
>X-Spam-Level:
>X-Spam-Status: No, score=-3.1 required=4.0 tests=AWL,FORGED_RCVD_HELO,
> LDOSUBSCRIBER,SPF_PASS autolearn=ham version=3.1.4
>
> What does 'find /f' produce?

find /f:

/f
/f/bin
/f/bin/bash
/f/lib
/f/lib/libncurses.so.5
/f/lib/ld-2.6.1.so
/f/lib/libdl.so.2
/f/lib/libc.so.6

--
Gérard
  Réponse avec citation
Vieux 20/08/2007, 20h30   #4
Neil Watson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chroot: cannot run command `/bin/bash': No such file or directory

On Mon, Aug 20, 2007 at 08:12:24PM +0200, Gerard Robin wrote:
> find /f:
>
>/f
>/f/bin
>/f/bin/bash
>/f/lib
>/f/lib/libncurses.so.5
>/f/lib/ld-2.6.1.so
>/f/lib/libdl.so.2
>/f/lib/libc.so.6


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.

--
Neil Watson | Debian Linux
System Administrator | Uptime 2 days
http://watson-wilson.ca


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 20/08/2007, 20h50   #5
Neil Watson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chroot: cannot run command `/bin/bash': No such file or directory

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.

--
Neil Watson | Debian Linux
System Administrator | Uptime 2 days
http://watson-wilson.ca


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 20/08/2007, 20h50   #6
Gerard Robin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chroot: cannot run command `/bin/bash': No such file or directory

On Mon, Aug 20, 2007 at 02:24:18PM -0400, Neil Watson wrote:
>From: Neil Watson <debian@watson-wilson.ca>
>To: debian-user@lists.debian.org
>Subject: Re: chroot: cannot run command `/bin/bash': No such file or directory
>X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on murphy.debian.org
>X-Spam-Level:
>X-Spam-Status: No, score=-4.3 required=4.0 tests=AWL,BAYES_00,
> FORGED_RCVD_HELO,IMPRONONCABLE_2,LDOSUBSCRIBER,SPF _PASS autolearn=no
> version=3.1.4
>
> On Mon, Aug 20, 2007 at 08:12:24PM +0200, Gerard Robin wrote:
>> find /f:
>>
>> /f
>> /f/bin
>> /f/bin/bash
>> /f/lib
>> /f/lib/libncurses.so.5
>> /f/lib/ld-2.6.1.so
>> /f/lib/libdl.so.2
>> /f/lib/libc.so.6

>
> 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*


--
Gérard
  Réponse avec citation
Vieux 20/08/2007, 22h40   #7
Gerard Robin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chroot: cannot run command `/bin/bash': No such file or directory

On Mon, Aug 20, 2007 at 02:44:31PM -0400, Neil Watson wrote:
>From: Neil Watson <debian@watson-wilson.ca>
>To: debian-user@lists.debian.org
>Subject: Re: chroot: cannot run command `/bin/bash': No such file or directory
>X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on murphy.debian.org
>X-Spam-Level:
>X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,BAYES_00,
> FORGED_RCVD_HELO,IMPRONONCABLE_1,IMPRONONCABLE_2,L DOSUBSCRIBER,
> MURPHY_WRONG_WORD1,MURPHY_WRONG_WORD2,SPF_PASS autolearn=no
> version=3.1.4
>
> 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/

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

--
Gérard
  Réponse avec citation
Vieux 21/08/2007, 00h30   #8
Ken Irving
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 21/08/2007, 09h10   #9
Gerard Robin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chroot: cannot run command `/bin/bash': No such file or directory

On Mon, Aug 20, 2007 at 02:19:49PM -0800, Ken Irving wrote:
>From: Ken Irving <fnkci@uaf.edu>
>To: debian-user@lists.debian.org
>Subject: Re: chroot: cannot run command `/bin/bash': No such file or
> directory
>Mail-Followup-To: debian-user@lists.debian.org
>X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on murphy.debian.org
>X-Spam-Level:
>X-Spam-Status: No, score=-5.0 required=4.0 tests=AWL,BAYES_00,IMPRONONCABLE_1,
> IMPRONONCABLE_2,LDOSUBSCRIBER,MURPHY_WRONG_WORD1,M URPHY_WRONG_WORD2
> autolearn=no version=3.1.4
>
>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


ok it's fine now, I am an idiot ;-)
Many thanks to you and to Neil.

--
Gérard
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h41.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16469 seconds with 17 queries