fixit console with sshd
Artis Caune
artis.caune at gmail.com
Thu May 14 12:03:02 UTC 2009
2009/4/28 n j <nino80 at gmail.com>:
> I was just wondering if someone could give me a quick advice on how
> (or at least confirm it's possible) to start sshd in fixit console
> i.e. how to boot FreeBSD off the CD1 (6.4-RELEASE) and enable SSH
> access to it.
>
> I believe booting off a live CD and restoring a backup over network
> should be a relatively common recovery scenario, but googling around
> produced no usable results other than "get FreeSBIE live cd".
or you can build your own live cd:
# BUILDDIR=/home/my_live_cd
# mkdir $BUILDDIR
# cd /usr/src
# make buildworld
# make buildkernel
# make installworld DESTDIR=$BUILDDIR
# make distribution DESTDIR=$BUILDDIR
# make installkernel DESTDIR=$BUILDDIR
echo '/dev/acd0 / cd9660 ro 0 0' >> $BUILDDIR/etc/fstab
echo 'init_script="/etc/rc.my"' >> $BUILDDIR/boot/loader.conf
echo "exec /bin/sh" > $BUILDDIR/etc/rc.my
# you probably should script /etc/rc.my and
# mount rw memory fs over /var, /tmp, and others
# add useful packages
mount -t devfs devfs $BUILDDIR/dev
for pkg in apg-2.3.0b_1 bonnie++-1.93.04 stress-1.0.0; do
cp /home/pkgs/${pkg}.tbz $BUILDDIR/
chroot $BUILDDIR pkg_add /${pkg}.tbz
rm $BUILDDIR/${pkg}.tbz
done
umount $BUILDDIR/dev
# generate ssh keys
chroot $BUILDDIR /etc/rc.d/sshd keygen
# mkisofs -quiet -b boot/cdboot -no-emul-boot -r -iso-level 4 -V "my
live cd" -o /home/my_live_cd.iso $BUILDDIR
# burncd -v -s max data /home/my_live_cd.iso fixate
You can even read some new manpages while fixing servers :)
--
Artis Caune
Everything should be made as simple as possible, but not simpler.
More information about the freebsd-questions
mailing list