Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
root@dd:/tmp/chroot# test -f
root@dd:/tmp/chroot# test -f lib/
root@dd:/tmp/chroot# test -f lib/ && echo 's'
root@dd:/tmp/chroot# test -f lib/ && echo 's' || echo 'f'
root@dd:/tmp/chroot# test -f lib/ && echo 's' || echo 'f'
root@dd:/tmp/chroot# test -f lib/ && echo 's' || echo 'f'
root@dd:/tmp/chroot# test -f lib64/ && echo 's' || echo 'f'
root@dd:/tmp/chroot# cd lib
root@dd:/tmp/chroot/lib# find . -name ''
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
root@dd:/tmp/chroot/lib64# cd lib64
root@dd:/tmp/chroot/lib64/lib64# ls
init                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           lsb                              modules                          plymouth                         security                               terminfo                      udev                           ufw                     xtables                            
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

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
up vote 3 down vote accepted


export LD_LIBRARY_PATH=/tmp/chroot/lib
/tmp/chroot/lib/ /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

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

Your Answer


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.