Strace chroot /bin/bash ausgeführt

Hallo Peter,

ich habe deinen Rat befolgt und den Befehl strace chroot /bin/bash
ausgeführt er hat mir folgende Ausgabe geliefert !

Ich kann damit allerdings überhaupt nichts anfangen :frowning:

execve("/usr/sbin/chroot", ["chroot", "/bin/bash"], [/* 24 vars */]) = 0
uname({sys="Linux", node="lana", ...}) = 0
brk(0) = 0x804b508
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=38785, ...}) = 0
old_mmap(NULL, 38785, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40012000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0]Z\1\000"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1102952, ...}) = 0
old_mmap(NULL, 1112708, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4001c000
mprotect(0x40124000, 31364, PROT_NONE) = 0
old_mmap(0x40124000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x107000) = 0x40124000
old_mmap(0x4012a000, 6788, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4012a000
close(3) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x4012c000
munmap(0x40012000, 38785) = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=18053568, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4012d000
mmap2(NULL, 237568, PROT_READ, MAP_PRIVATE, 3, 0x274) = 0x4032d000
brk(0) = 0x804b508
brk(0x804c508) = 0x804c508
brk(0) = 0x804c508
brk(0x804d000) = 0x804d000
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0x2e5) = 0x40012000
close(3) = 0
chroot("/bin/bash") = -1 ENOTDIR (Not a directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2598, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40013000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2598
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40013000, 4096) = 0
open("/usr/share/locale/de/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=239870, ...}) = 0
old_mmap(NULL, 239870, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40367000
close(3) = 0
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/lib/gconv/gconv-modules", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=44467, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40013000
read(3, "# GNU libc iconv configuration.\n"..., 4096) = 4096
brk(0) = 0x804d000
brk(0x804e000) = 0x804e000
read(3, "2//\nalias\tJS//\t\t\tJUS_I.B1.002//\n"..., 4096) = 4096
brk(0) = 0x804e000
brk(0x804f000) = 0x804f000
brk(0) = 0x804f000
brk(0x8050000) = 0x8050000
read(3, "1\nmodule\tINTERNAL\t\tISO-8859-3//\t"..., 4096) = 4096
brk(0) = 0x8050000
brk(0x8051000) = 0x8051000
brk(0) = 0x8051000
brk(0x8052000) = 0x8052000
read(3, "\nalias\tLATIN8//\t\tISO-8859-14//\na"..., 4096) = 4096
brk(0) = 0x8052000
brk(0x8053000) = 0x8053000
brk(0) = 0x8053000
brk(0x8054000) = 0x8054000
read(3, "as\tCSEBCDICESS//\t\tEBCDIC-ES-S//\n"..., 4096) = 4096
brk(0) = 0x8054000
brk(0x8055000) = 0x8055000
brk(0) = 0x8055000
brk(0x8056000) = 0x8056000
read(3, "NAL\t\tIBM285\t\t1\nmodule\tINTERNAL\t\t"..., 4096) = 4096
brk(0) = 0x8056000
brk(0x8057000) = 0x8057000
brk(0) = 0x8057000
brk(0x8058000) = 0x8058000
read(3, "ias\tCP866//\t\t\tIBM866//\nalias\t866"..., 4096) = 4096
brk(0) = 0x8058000
brk(0x8059000) = 0x8059000
read(3, "1004\t\t1\nmodule\tINTERNAL\t\tIBM1004"..., 4096) = 4096
brk(0) = 0x8059000
brk(0x805a000) = 0x805a000
brk(0) = 0x805a000
brk(0x805b000) = 0x805b000
read(3, "//\t\tEUC-TW\t\t1\n\n#\tfrom\t\t\tto\t\t\tmod"..., 4096) = 4096
brk(0) = 0x805b000
brk(0x805c000) = 0x805c000
brk(0) = 0x805c000
brk(0x805d000) = 0x805d000
read(3, "03//\t\tINTERNAL\t\tCSN_369103\t1\nmod"..., 4096) = 4096
brk(0) = 0x805d000
brk(0x805e000) = 0x805e000
brk(0) = 0x805e000
brk(0x805f000) = 0x805f000
read(3, "SO-IR-8-1//\t\tNATS-SEFI//\nalias\tC"..., 4096) = 3507
brk(0) = 0x805f000
brk(0x8060000) = 0x8060000
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40013000, 4096) = 0
brk(0) = 0x8060000
brk(0x8061000) = 0x8061000
open("/usr/lib/gconv/ISO8859-15.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\4\7\0\000"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0644, st_size=7448, ...}) = 0
old_mmap(NULL, 10176, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40013000
mprotect(0x40015000, 1984, PROT_NONE) = 0
old_mmap(0x40015000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x1000) = 0x40015000
close(3) = 0
brk(0) = 0x8061000
brk(0x8069000) = 0x8069000
brk(0) = 0x8069000
brk(0x806a000) = 0x806a000
brk(0) = 0x806a000
brk(0x806b000) = 0x806b000
write(2, "chroot: ", 8chroot: ) = 8
write(2, "Es ist nicht m\366glich, das Wurzel"..., 66Es ist nicht
möglich, das Wurzelverzeichnis in /bin/bash zu ändern) = 66
open("/usr/share/locale/de/LC_MESSAGES/libc.mo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=88888, ...}) = 0
old_mmap(NULL, 88888, PROT_READ, MAP_PRIVATE, 3, 0) = 0x403a2000
close(3) = 0
open("/usr/lib/gconv/ISO8859-1.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\4\7\0\000"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0644, st_size=5944, ...}) = 0
old_mmap(NULL, 8672, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40016000
mprotect(0x40018000, 480, PROT_NONE) = 0
old_mmap(0x40018000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x1000) = 0x40018000
close(3) = 0
brk(0) = 0x806b000
brk(0x8073000) = 0x8073000
brk(0) = 0x8073000
brk(0x8074000) = 0x8074000
write(2, ": Ist kein Verzeichnis", 22: Ist kein Verzeichnis) = 22
write(2, "\n", 1
) = 1
semget(1, 1074959328, 0) = -1 ENOSYS (Function not
implemented)
_exit(1) = ?

hallo

Ich kann damit allerdings überhaupt nichts anfangen :frowning:

execve("/usr/sbin/chroot", ["chroot", "/bin/bash"], [/* 24 vars */]) = 0
chroot("/bin/bash") = -1 ENOTDIR (Not a directory)

die beiden zeilen zeigen dass du chroot so ausgefuehrt hast:
chroot /bin/bash

das ist aber falsch. chroot hat als ersten parameter das verzeichnis das
das neue rootverzeichnis sein soll und als optionalen zweiten parameter
das programm das es starten soll.

der korrekte aufruf ist so:
chroot <newroot> /bin/bash, wobei newroot das verzeichnis sein muss
welches das neue rootverzeichnis sein soll, z.b
chroot /mnt/ /bin/bash

in dem neuen root-verzeichnis muss natuerlich auch ein lauffaehiges system
drin sein.

peter