Skip to content

Configure doas on the OpenBSD images #75

Description

@alexander-naumov

Configure doas in the OpenBSD VM images so that the runner user can execute commands as root with it, in addition to the existing sudo support.

Background

This issue started as a question about how to install packages on OpenBSD (see the comments below). The answer is that sudo is available and already configured — it's documented in the openbsd-builder repository — but doas is not:

$ doas pkg_add package_name
doas: doas is not enabled, /etc/doas.conf: No such file or directory

doas is OpenBSD's own privilege escalation tool and the one OpenBSD users will reach for first, so its absence is surprising on an OpenBSD image even though sudo works.

Proposal

  • Ship an /etc/doas.conf in the OpenBSD images that permits the runner user to run commands as root without a password, mirroring the current sudo configuration.
  • Keep sudo configured exactly as it is today. Workflows that run the same script across several operating systems rely on sudo being available everywhere, so it should stay as the portable option.
  • Document doas alongside sudo in the openbsd-builder readme.

The implementation lands in openbsd-builder, not in this repository.

Original question by @alexander-naumov

Hello,
I'm trying to use this action for OpenBSD build. I need to install dependency inside OpenBSD.
As I can see, it runs as runner user. This user is not allowed to install packages.

pkg_add package_name doesn't work.
We get an error pkg_add: pkg_add must be run as root. This is correct. Normally we execute pkg_add as a root user or via doas.

doas pkg_add package_name doesn't work.
We get an error doas: doas is not enabled, /etc/doas.conf: No such file or directory

So, my question is: how to install software inside OpenBSD?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestoperating systemRequest for supporting a new operating system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions