Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
root@dd:/tmp/chroot# test -f
root@dd:/tmp/chroot# test -f lib/libncurses.so.5
root@dd:/tmp/chroot# test -f lib/libncurses.so.5 && echo 's'
s
root@dd:/tmp/chroot# test -f lib/libncurses.so.5 && echo 's' || echo 'f'
s
root@dd:/tmp/chroot# test -f lib/libdl.so.2 && echo 's' || echo 'f'
s
root@dd:/tmp/chroot# test -f lib/libc.so.6 && echo 's' || echo 'f'
s
root@dd:/tmp/chroot# test -f lib64/ld-linux-x86-64.so.2 && echo 's' || echo 'f'
f
root@dd:/tmp/chroot# cd lib
root@dd:/tmp/chroot/lib# find . -name 'ld-linux-x86-64.so.2'
./ld-linux-x86-64.so.2
root@dd:/tmp/chroot/lib# cd ..
root@dd:/tmp/chroot# cd lib64
bash: cd: lib64: no such file or directory
root@dd:/tmp/chroot# mkdir lib64
root@dd:/tmp/chroot# cd lib64
root@dd:/tmp/chroot/lib64# cp -a /lib64 .
root@dd:/tmp/chroot/lib64# ls
lib64
root@dd:/tmp/chroot/lib64# cd lib64
root@dd:/tmp/chroot/lib64/lib64# ls
cpp                                   libgcc_s.so.1                libply-splash-core.so.2
dbus-1.0                              libgcrypt.so.11              libply-splash-core.so.2.0.0
firmware                              libgcrypt.so.11.5.2          libply-splash-graphics.so.2
hdparm                                libglib-2.0.so.0             libply-splash-graphics.so.2.0.0
init                                  libglib-2.0.so.0.2400.1      libply.so.2
klibc-usBAintlt99f0TITo98H_trqH2c.so  libgpg-error.so.0            libply.so.2.0.0
ld-2.11.1.so                          libgpg-error.so.0.4.0        libpng12.so.0
ld-linux-x86-64.so.2                  libhistory.so.5              libpng12.so.0.42.0
ld-linux.so.2                         libhistory.so.5.2            libpopt.so.0
libBrokenLocale-2.11.1.so             libhistory.so.6              libpopt.so.0.0.0
libBrokenLocale.so.1                  libhistory.so.6.1            libproc-3.2.8.so
libSegFault.so                        libiptc.so.0                 libpthread-2.11.1.so
libacl.so.1                           libiptc.so.0.0.0             libpthread.so.0
libacl.so.1.1.0                       libiw.so.30                  libreadline.so.5
libanl-2.11.1.so                      libkeyutils-1.2.so           libreadline.so.5.2
libanl.so.1                           libkeyutils.so.1             libreadline.so.6
libatasmart.so.4                      libm-2.11.1.so               libreadline.so.6.1
libatasmart.so.4.0.3                  libm.so.6                    libresolv-2.11.1.so
libatm.so.1                           libmemusage.so               libresolv.so.2
libatm.so.1.0.0                       libncurses.so.5              librt-2.11.1.so
libattr.so.1                          libncurses.so.5.7            librt.so.1
libattr.so.1.1.0                      libncursesw.so.5             libselinux.so.1
libblkid.so.1                         libncursesw.so.5.7           libsepol.so.1
libblkid.so.1.1.0                     libnih-dbus.so.1             libslang.so.2
libbsd.so.0                           libnih-dbus.so.1.0.0         libslang.so.2.2.2
libbsd.so.0.2.0                       libnih.so.1                  libss.so.2
libbz2.so.1                           libnih.so.1.0.0              libss.so.2.0
libbz2.so.1.0                         libnsl-2.11.1.so             libssl.so.0.9.8
libbz2.so.1.0.4                       libnsl.so.1                  libsysfs.so.2
libc-2.11.1.so                        libnss_compat-2.11.1.so      libsysfs.so.2.0.1
libc.so.6                             libnss_compat.so.2           libthread_db-1.0.so
libcap.so.2                           libnss_dns-2.11.1.so         libthread_db.so.1
libcap.so.2.17                        libnss_dns.so.2              libtic.so.5
libcidn-2.11.1.so                     libnss_files-2.11.1.so       libtic.so.5.7
libcidn.so.1                          libnss_files.so.2            libticw.so.5
libcom_err.so.2                       libnss_hesiod-2.11.1.so      libticw.so.5.7
libcom_err.so.2.1                     libnss_hesiod.so.2           libudev.so.0
libcrypt-2.11.1.so                    libnss_mdns.so.2             libudev.so.0.6.1
libcrypt.so.1                         libnss_mdns4.so.2            libulockmgr.so.1
libcrypto.so.0.9.8                    libnss_mdns4_minimal.so.2    libulockmgr.so.1.0.1
libdbus-1.so                          libnss_mdns6.so.2            libusb-0.1.so.4
libdbus-1.so.3                        libnss_mdns6_minimal.so.2    libusb-0.1.so.4.4.4
libdbus-1.so.3.4.0                    libnss_mdns_minimal.so.2     libusb-1.0.so.0
libdevmapper.so.1.02.1                libnss_nis-2.11.1.so         libusb-1.0.so.0.0.0
libdl-2.11.1.so                       libnss_nis.so.2              libutil-2.11.1.so
libdl.so.2                            libnss_nisplus-2.11.1.so     libutil.so.1
libdrm.so.2                           libnss_nisplus.so.2          libuuid.so.1
libdrm.so.2.4.0                       libntfs-3g.so.75             libuuid.so.1.3.0
libdrm_intel.so.1                     libntfs-3g.so.75.0.0         libwrap.so.0
libdrm_intel.so.1.0.0                 libpam.so.0                  libwrap.so.0.7.6
libdrm_nouveau.so.1                   libpam.so.0.82.2             libxtables.so.2
libdrm_nouveau.so.1.0.0               libpam_misc.so.0             libxtables.so.2.0.0
libdrm_radeon.so.1                    libpam_misc.so.0.82.0        libz.so.1
libdrm_radeon.so.1.0.0                libpamc.so.0                 libz.so.1.2.3.3
libe2p.so.2                           libpamc.so.0.82.1            lsb
libe2p.so.2.3                         libparted.so.0               modules
libexpat.so.1                         libparted.so.0.0.1           plymouth
libexpat.so.1.5.2                     libpcprofile.so              security
libexpatw.so.1                        libpcre.so.3                 terminfo
libexpatw.so.1.5.2                    libpcre.so.3.12.1            udev
libext2fs.so.2                        libpcsclite.so.1             ufw
libext2fs.so.2.4                      libpcsclite.so.1.0.0         xtables
libfuse.so.2                          libply-boot-client.so.2
libfuse.so.2.8.1                      libply-boot-client.so.2.0.0
root@dd:/tmp/chroot/lib64/lib64# mv * ../
root@dd:/tmp/chroot/lib64/lib64# cd ..
root@dd:/tmp/chroot/lib64# ls
bash: /bin/ls: no such file or directory
root@dd:/tmp/chroot/lib64# ls
bash: /bin/ls: no such file or directory
root@dd:/tmp/chroot/lib64# cd ..
root@dd:/tmp/chroot# ls
bash: /bin/ls: no such file or directory
root@dd:/tmp/chroot# 

First of all, sorry for bad english... As seen above, even though the server did not perform a delete command has failed. Why is this happening? How do I import my local files? (SFTP, FTP is not working now T_T)

share|improve this question
    
edit scratch that, I see it happens outside the chroot. –  rackandboneman May 17 '12 at 15:47
add comment

2 Answers

up vote 3 down vote accepted

Try

export LD_LIBRARY_PATH=/tmp/chroot/lib
/tmp/chroot/lib/ld-linux-x86-64.so.2 /bin/ls
share|improve this answer
    
thanks but.. when I type code, It prints "bash: export: `/bin/ls': not valid name"... –  user1362462 May 17 '12 at 15:58
    
but without export... it works!!! –  user1362462 May 17 '12 at 15:59
    
these are two distinct commands. sorry for the edit storm. –  rackandboneman May 17 '12 at 15:59
    
it will work as a single line without export, but then you will have to prepend every time. IF both systems (in and out of chroot) are amd64, you can now probably make a copy command work to replace the linker in the outer system. –  rackandboneman May 17 '12 at 16:01
    
How can I recover this system? I want to use other commands, but it failed "/bin/clear: error while loading shared libraries: /bin/clear: cannot open shared object file: No such file or directory" –  user1362462 May 17 '12 at 16:01
show 2 more comments

First place I would start is by checking if that /bin directory is intact. You can do this by executing the following:

cd /bin
echo *

Could also have been the doing of someone who has comprimised your system and is looking to cover their tracks as well. First thing you likely want to do is load up a live CD and check the md5's. /bin/ls not found even though it exists.

share|improve this answer
    
Thanks. bin folder exists and files in bin folder exists too. –  user1362462 May 17 '12 at 16:02
    
if you enter echo $PATH is /bin listed? –  Rob May 17 '12 at 16:04
    
# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games –  user1362462 May 17 '12 at 16:04
    
Many thanks!!!! –  user1362462 May 17 '12 at 16:12
    
Yes, and I think everything works fine now. Many thanks again T_T –  user1362462 May 17 '12 at 16:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.