DEV Community

Cover image for How to run OpenBSD 6.3 instance on Vultr
manuel
manuel

Posted on • Originally published at wildauer.io on

3 2

How to run OpenBSD 6.3 instance on Vultr

Create a new instance and select OpenBSD 6.3 as operating system. After a minute you can login on your new instance over ssh.

First we set the installurl and then we should patch the machine with syspatch.

The /etc/installurl file contains a single line specifying an OpenBSD mirror server URL. syspatch is a utility to fetch, verify, install and revert OpenBSD binary patches.

echo 'https://fastly.cdn.openbsd.org/pub/OpenBSD' > /etc/installurl && syspatch
Enter fullscreen mode Exit fullscreen mode

Now we create a new user to the system with adduser and then we add them to /etc/doas.conf.

With doas, we can execute commands as another user, for example as root.

echo "permit YOUR_NEW_USER" > /etc/doas.conf
Enter fullscreen mode Exit fullscreen mode

Add a ssh key to you new user. Open a Terminal on your local machine and execute

ssh-copy-id -i path/to/your/public.key YOUR_NEW_USER@server
Enter fullscreen mode Exit fullscreen mode

Switch back to your OpenBSD instance and edit the ssh daemon configuration in /etc/ssh/sshd_config.

We don’t allow login over ssh as root

PermitRootLogin no

We disable login with passsword over ssh

PasswordAuthentication no

Now check the configuration with

sshd -t
Enter fullscreen mode Exit fullscreen mode

and restart the ssh daemon with

rcctl restart sshd
Enter fullscreen mode Exit fullscreen mode

Now you should be able to login with YOUR_NEW_USER over ssh without a password. If it works, close your root connection and switch to YOUR_NEW_USER.

We need to set some network informations. You can find all information on my vultr

Populate the /etc/mygate file with your gateway

echo YOUR_GATEWAY > /etc/mygate
Enter fullscreen mode Exit fullscreen mode

Populate /etc/hostname.vio0 with following text

inet YOUR_INSTANCE_IP 255.255.254.0 NONE
inet6 autoconf -autoconfprivacy -soii

Enter fullscreen mode Exit fullscreen mode

Populate /etc/resolv.conf with following text

nameserver 108.61.10.10
lookup file bind

Enter fullscreen mode Exit fullscreen mode

That’s it. No we have a running OpenBSD 6.3 instance on vultr.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay