Re: Missing bin directory

From: Michael Heiming (michael+USENET_at_www.heiming.de)
Date: 09/11/03


Date: Thu, 11 Sep 2003 14:03:09 +0200

Andy Baxter <news2@earthsong.null.free-online.co.uk> wrote:
> Dan Grabbybear wrote:

> > The /bin directory was deleted by accident on a server with only telnet
> > access, and I'm wondering how I can get back some basic commands such as
> > cp
> > and mkdir. I have ftp access. Would it be possible to ftp an equivalent
> > binary? Is it possible recreate the bin directory without mkdir or a cd?
> > Thanks.

> I'm assuming that you still have /usr/bin? Try using the built-in copy
> function from midnight commander or a similar utility. This almost
> certainly works using the standard unix functions not the cp command from
> /bin, so as long as you still have /lib (most likely /lib/libc.so.6), it
> might work.
> Or you could run sshd on the server and use scp?
> Also, the commands don't need to be in /bin in order to run - this is just
> for convenience so they can be found through $PATH. So you could ftp a
> suitable version of cp+mkdir to your usual ftp directory, then run them
> from there using './cd' .

cd is AFAIR a bash builtin, and that's the problem with your advise, unless
you have a user that has another shell which isn't in /bin (but even then
you won't be able to 'su -')or you have root ftp access (you shouldn't),
I have not much hope, as you don't have bash anymore.;(

I'd hard reset the system, boot from some rescue media and restore /bin
from a backup, or from another identical system.

Let's take a look on my box (RH 7.3) what packages are in bin:

$ rpm -qf /bin/* | sort | uniq
ash-0.3.7-2
aumix-2.7-8
awesfx-0.4.3a-8
bash-2.05a-13
console-tools-19990829-40
cpio-2.4.2-26
ed-0.2-25
file /bin/chroot-shell is not owned by any package
fileutils-4.1-10.1
gawk-3.1.3-1
gettext-0.11.4-0.rh73.3
grep-2.5.1-1
gzip-1.3.3-1
initscripts-6.67-1
iputils-20020124-3
ksh93-2000.10.31.0-1
mailx-8.1.1-22
mktemp-1.5-14
mount-2.11n-12.7.3
mt-st-0.7-3
net-tools-1.60-4
procps-3.1.8-3
rpm-4.0.4-7x.18
sed-4.0.7-1
setserial-2.17-5
sh-utils-2.0.11-14
tar-1.13.25-4.7.1
tcsh-6.10-6
textutils-2.0.21-4
util-linux-2.11n-12.7.3
vim-minimal-6.1-18.7x.2
zsh-4.1.1-1

-- 
Michael Heiming
Remove +SIGNS and www. if you expect an answer, sorry for 
inconvenience, but I get tons of SPAM


Relevant Pages

  • Re: Mime type?
    ... options for not sending these commands. ... >>I was into the Fetch FTP web site and this is what I found - it looks ... >> My server does not recognize them. ...
    (microsoft.public.inetserver.iis)
  • Re: Anyone know how to complete this script?
    ... Then you can set an envionmental variable such as "DAT" and call it in a script ... Then you can create a text file (FTP-CMD.TXT) of commands that can then be used by using FTP ...
    (microsoft.public.win2000.general)
  • Re: Script that checks for existence of file on remote server.
    ... that the file was FTP'd over onto the REMOTE system, ... If you are administrator of both systems and can do remote shell ... commands, you can simply set up so that you can issue "rsh" commands. ... If you must use FTP to do this, you can always capture your FTP ...
    (comp.unix.aix)
  • Re: Missing bin directory
    ... I have ftp access. ... Is it possible recreate the bin directory without mkdir or a cd? ... the commands don't need to be in /bin in order to run - this is just ...
    (comp.os.linux.misc)
  • Re: [SLE] SuSE 9.3 FTP AVAILABLE !?
    ... On Tue April 19 2005 7:18 pm, Philipp Thomas wrote: ... > The FTP tree contains those packages that are only available on the DVD, ... For additional commands send e-mail to suse-linux-e-help@suse.com ...
    (SuSE)