Re: Missing bin directory
From: Michael Heiming (michael+USENET_at_www.heiming.de)
Date: 09/11/03
- Next message: Michael Heiming: "Re: How to lockup linux ! But how to prevent this ?"
- Previous message: David Ewer: "Freeing up disk space..."
- In reply to: Andy Baxter: "Re: Missing bin directory"
- Next in thread: Andy Baxter: "Re: Missing bin directory"
- Reply: Andy Baxter: "Re: Missing bin directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Michael Heiming: "Re: How to lockup linux ! But how to prevent this ?"
- Previous message: David Ewer: "Freeing up disk space..."
- In reply to: Andy Baxter: "Re: Missing bin directory"
- Next in thread: Andy Baxter: "Re: Missing bin directory"
- Reply: Andy Baxter: "Re: Missing bin directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|