| DOAS(1) | General Commands Manual | DOAS(1) |
doas — execute
commands as another user
doas |
[-Lns] [-a
style] [-C
config] [-u
user] command
[arg ...] |
The doas utility executes the given
command as another user. The command argument is
mandatory unless -C, -L, or
-s is specified.
The user will be required to authenticate by entering their password, unless configured otherwise.
By default, a new environment is created. The variables
HOME, LOGNAME,
PATH, SHELL, and
USER and the
umask(2) are set to values
appropriate for the target user. DOAS_USER is set to
the name of the user executing doas. The variables
DISPLAY and TERM are
inherited from the current environment. This behavior may be modified by the
config file. The working directory is not changed.
The options are as follows:
-a
style-C
configdoas 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. No command is executed.-L-nnopass option.-sSHELL or
/etc/passwd.-u
userThe doas utility exits 0 on
success, and >0 if an error occurs. It may fail for one of the
following reasons:
The doas command first appeared in
OpenBSD 5.8.
Ted Unangst <tedu@openbsd.org>
| December 22, 2022 | openbsd |