Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2009 14:29:53 +0300
From:      Artis Caune <artis.caune@gmail.com>
To:        n j <nino80@gmail.com>
Cc:        User Questions <freebsd-questions@freebsd.org>
Subject:   Re: fixit console with sshd
Message-ID:  <9e20d71e0905140429m12fdec2dp12f705dfb28c394@mail.gmail.com>
In-Reply-To: <92bcbda50904281344yba00584wcb32444c4e817cca@mail.gmail.com>
References:  <92bcbda50904281344yba00584wcb32444c4e817cca@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/4/28 n j <nino80@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9e20d71e0905140429m12fdec2dp12f705dfb28c394>