View Single Post
  #1   (View Single Post)  
Old 23rd May 2008
Dazhelpwiz Dazhelpwiz is offline
Port Guard
Join Date: May 2008
Location: Townsville, Australia
Posts: 34
Exclamation Remote OpenBSD install via ssh.

I had a remote FreeBSD 6.3 box that I wanted OpenBSD to be on instead. I thought I would post this as to help anyone else who wanted to as I found very little on the net.

This could pretty much work with any base os. I am in no way up to speed with fdisk and disklabels enough to try and repartition the boot drive, but I cant see why it wouldnt work with that too.

The remote server came with raid so I disabled and used the second drive for this.

Install grub onto the base os. do as superuser...

in FreeBSD:


  -    devel/autoconf-wrapper-20071109.tbz
  -    devel/m4-1.4.9,1.tbz
  -    devel/perl-5.8.8_1

  -    devel/automake-wrapper-20071109.tbz

  -   converters/libiconv-1.11_1.tbz


  -    devel/p5-gettext-1.05_1.tbz




#sysctl kern.geom.debugflags=16
#grub-install /dev/ad4 (substitute for your boot drive)
grub> find /boot/grub/stage1
 - (hd0,0,a) :should be the result
grub> root (hd0,0,a)
 - Filesystem type is ufs2, partition type 0xa5
grub> setup (hd0)

#cd /boot/grub
#touch menu.lst
#vi menu.lst (or whatever your preferred editor is)


timeout 10
title FreeBSD 6.3
root (hd0,0,a)
kernel /boot/loader
title OpenBSD 4.2
root (hd1) 
chainloader +1
Now we need to build the yaifo (yet another installer for openbsd) which can be obtained from:

The info we need about the target machine is:

interface, ip, gateway, subnet and dns (openbsd usually detects it the same as freebsd)

FTP src.tar.gz and sys.tar.gz from into /usr/src.

#tar xzf src.tar.gz && tar zxf sys.tar.gz
#cd ..
#tar xzf yaifo-XX.tar.gz
#cd yaifo-XX (this assumes u unpacked yaifo into /usr/yaifo-xxxx)
edit config file and enter the information for the target machine. be sure to specify the interface if more then two exist in the target box.

#ssh-keygen -t rsa
#cat ~/.ssh/ >> ~/.ssh/authorized_keys
#cp ~/.ssh/authorized_keys .

FTP id_rsa to your laptop or machine you intend doing the ssh connection from.

#make obj && make

ftp yaifo.fs and yaifo.rd to same machine as id_rsa.

convert id_rsa with puttygen if you use putty.

FTP yaifo.fs to the freebsd machine.
on the freebsd box.

#dd if=yaifo.fs of=/dev/ad6

now swap the grub entries in menu.lst in /boot/grub, so the openbsd entry is above the freebsd entry.

save and reboot the freebsd box.
Now login into your now waiting to be OpenBSD machine with the converted rsa key and install.

I hope you find this useful. Obviously, small changes will apply on whatever base os your starting from. This is no way a full proof guide so do say at your own risk of bricking your remote machine, however it went off without a hitch for me.

Yaifo is now available for 4.3 (I did this with 4.2 as yaifo for 4.3 wasnt ready yet and its taken me a while to get back to posting this).

on the openbsd box.

Last edited by Dazhelpwiz; 23rd May 2008 at 04:10 AM.
Reply With Quote