OpenBSD manual page server

Manual Page Search Parameters

DOAS(1) General Commands Manual DOAS(1)

doasexecute commands as another user

doas [-ns] [-a style] [-C config] [-u user] command [args]

The doas utility executes the given command as another user. The command argument is mandatory unless -C or -s is specified.

The options are as follows:

style
The -a (authentication style) option causes doas to use the specified authentication style when validating the user, as allowed by /etc/login.conf. The system administrator may specify a list of doas-specific authentication methods by adding an ‘auth-doas’ entry in /etc/login.conf.
config
Parse and check the configuration file config, then exit. If command is supplied, doas will also perform command matching. In the latter case either ‘permit’, ‘permit nopass’ or ‘deny’ will be printed on standard output, depending on command matching results. In either case, no command is executed.
Non interactive mode, fail if doas would prompt for password.
Execute the shell from SHELL or /etc/passwd.
user
Execute the command as user. The default is root.

The doas utility exits 0 on success, and >0 if an error occurs. It may fail for one of the following reasons:

su(1), doas.conf(5)

The doas command first appeared in OpenBSD 5.8.

Ted Unangst <‍tedu@openbsd.org>

December 8, 2015 OpenBSD-5.9