This is a collection of shell scripts and notes to help me administer my OpenBSD setup. I hope you find bits and pieces useful.
I would like to thank the OpenBSD developers for writing excellent documentation. You should check the official documentation first.
An installation USB stick can be made easily on another OpenBSD system. Plug in a USB stick, then find it using:
$ dmesg | grep -i verbatim
Where verbatim
is the manufacturer of the stick (change as needed).
Use the disk that you found in the command below instead of sdX
:
$ ./stick.sh sdX
Need to plug the stick into the back of the computer (my BIOS won't boot a stick plugged into a front port). Unplug the mouse, as the mouse keeps sending information which is echoed to the console.
System hostname = bsd
Network interface to configure = re0
IPv4 address for re0 = autoconf
IPv6 address for re0 = none
Network interface to configure = done
Start sshd(8) by default = no
Do you want the X Window System to be started by xenodm(1) = yes
Change the default console to com0 = no
Setup a user.
Which disk? Press ? to get the list, as you will need to know
which one is the installation stick for the step below.
Which disk is the root disk = sd1
Encrypt the root disk with a (p)assphrase or (k)eydisk = no
Use (W)hole disk MBR, whole disk (G)PT, (O)penBSD area or (E)dit = g
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout = e
?
p g
Check that all the space is being used: free: 0.0G
w
q
Which disk do you wish to initialize = done
Location of sets = disk
Is the disk partition already mounted = no
Which disk contains the install media = sd3
Which sd3 partition has the install sets = a
Pathname to the sets = 7.6/amd64
Set name(s) = done
Directory does not contain SHA256.sig. Continue without verification = yes
Location of sets = done
reboot
F2
remove the stick
$ su
# pkg_add git
# exit
$ git clone https://github.com/loganpkg/openbsd_scripts.git
$ cd openbsd_scripts
$ su
# ./root_setup.sh
# exit
$ ./user_setup.sh
$ doas reboot
Running mail
creates the ~/mbox
file, which contains the answers to the
installation questions.