
When deploying a new server instance, one of the security best practices is to enable full disk encryption on the machine, adding a second layer of security to your data. This article explains how to set up an OpenBSD 7.0 server instance with full disk encryption at Vultr.
Because the OpenBSD amd64 7.0 image is not in the public Vultr ISO Library yet, you need to upload it to Vultr by yourself.
Having the OpenBSD amd64 7.0 image in place, hover your mouse over the blue + icon on the upper right corner of the Vultr Control Panel page, and then click Deploy New Server to deploy a new server instance.
Among other settings, in the Server Type section, be sure to choose install70.iso from the My ISOs line within the Upload ISO tab.
After your machine gets up and running, collect its networking information from the Settings tab in the Server Details page for later use. The IP addresses listed below are for demonstration purposes only.
Note: Some browser extensions, including but not limited to Vimium, could interfere with your input in the noVNC console window. Disable those extensions when using a noVNC console.
Click the View Console button on the upper right corner of the Server Details page to open a noVNC console window. Use this console window to access your server instance and begin the installation of OpenBSD amd64 7.0 with full disk encryption:
In the OpenBSD shell, use the following command to find any hard disks on your server instance:
As you see, sd0 stands for a single Small Computer System Interface (SCSI) hard disk on this machine, which is the most common configuration on Vultr.
To make the OpenBSD 7.0 system recognize that SCSI hard disk, create a device file with the same name sd0 in the system using the MAKEDEV script:
Optionally, overwrite the whole disk with random data to prevent unauthorized space usage deductions:
Use the fdisk command to write a default Master Boot Record (MBR) boot code to the sd0 disk:
Create a partition layout on sd0 with the disklabel command, allocating all available disk space:
Build an encrypted device named softraid0 with the sd0a partition:
Important: Don't lose the passphrase you input here, or you won't be able to access the data within the machine.
Create the required sd1 pseudo-device file:
Clear the first megabyte of sd1 for storing MBR data later:
Exit the OpenBSD shell and return to the welcome prompt:
Start the installation:
Go through the installation program as follows to install OpenBSD amd64 7.0 with full disk encryption for production. Main points you should know during the installation:
Replace all example networking configurations with your own.
For security purposes, set strong passwords for the root user and the newly created user, and do not allow root to log in from SSH.
The X Window System and games are unnecessary for building a production website. De-select those sets to save disk space.
Be sure to input sd1 as the root disk.
Because the matching SHA256 signature is not uploaded, input yes to continue the installation.
Having OpenBSD 7.0 installed, you need to make the system boot from the hard disk other than the OpenBSD amd64 7.0 ISO image. To do so, Return to the Server Details page of your machine in the Vultr Control Panel, click the Remove ISO button in the Custom ISO column in the Settings tab.
Open a new noVNC console window.
Input the passphrase you set up earlier to start the fully encrypted system.
Log in as root from the same noVNC console window.
Grant doas permissions to the newly created johndoe user:
Patch and then reboot the system:
After the system gets up and running again, input your passphrase to start the system.
On your desktop machine, create a public/private RSA key pair and then upload the public key to your OpenBSD server instance:
Login in to your OpenBSD as johndoe from an SSH console, and then disable password authentication as follows:
From now on, log in from SSH with your private key:
Learn more about OpenBSD by visiting the following pages:
0 Comments
Be the first to comment and share your perspective with the community.