Linux

Where Is the doas Config File?

doas reads /etc/doas.conf, a small rule file that replaces sudo with permit and deny lines.

Last updated

doas configures privilege escalation in one small file with permit and deny rules. Compared to sudoers it reads like plain language, which is exactly the point.

Test every edit before logging out. A syntax error locks out privilege escalation entirely, and recovery needs single user mode or a live environment.

Where OpenBSD doas stores this, by platform

Linux
/etc/doas.conf

Single rule file, root owned at 0400. Example: permit persist user as root. Validate mentally since no visudo equivalent ships everywhere; some distros package vidoas.

Frequently asked questions

how do i give a user full root with doas

Add permit persist username as root to /etc/doas.conf. Keep a root shell open while testing so a typo cannot lock you out.

doas says permission denied after editing config

The rule order or syntax is wrong since last match wins. Review the file from a root shell and fix the offending line before closing it.

Notice an outdated path? Let us know.