]> git.armaanb.net Git - opendoas.git/blob - doas.conf.5
add some missing content and markup and optimize some indentation
[opendoas.git] / doas.conf.5
1 .\" $OpenBSD: doas.conf.5,v 1.2 2015/07/16 21:24:07 nicm Exp $
2 .\"
3 .\"Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
4 .\"
5 .\"Permission to use, copy, modify, and distribute this software for any
6 .\"purpose with or without fee is hereby granted, provided that the above
7 .\"copyright notice and this permission notice appear in all copies.
8 .\"
9 .\"THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\"WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\"MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\"ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .Dd $Mdocdate: July 16 2015 $
17 .Dt DOAS.CONF 5
18 .Os
19 .Sh NAME
20 .Nm doas.conf
21 .Nd doas configuration file
22 .Sh DESCRIPTION
23 The
24 .Xr doas 1
25 utility executes commands as other users according to the rules
26 in the
27 .Nm
28 configuration file.
29 .Pp
30 The rules have the following format:
31 .Bd -ragged -offset indent
32 .Ic permit Ns | Ns Ic deny
33 .Op Ar options
34 .Op Ar identity
35 .Op Ic as Ar target
36 .Op Ic cmd Ar command
37 .Ed
38 .Pp
39 Rules consist of the following parts:
40 .Bl -tag -width 11n
41 .It Ic permit Ns | Ns Ic deny
42 The action to be taken if this rule matches.
43 .It Ar options
44 Options are:
45 .Bl -tag -width keepenv
46 .It Ic nopass
47 The user is not required to enter a password.
48 .It Ic keepenv
49 The user's environment is maintained.
50 The default is to reset the environment.
51 .It Ic keepenv { Oo variable names Oc Ic }
52 Reset the environment, but keep the specified variables.
53 .El
54 .It Ar identity
55 The username to match.
56 Groups may be specified by prepending a colon (:).
57 Numeric IDs are also accepted.
58 .It Ic as Ar target
59 The target user the running user is allowed to run the command as.
60 The default is root.
61 .It Ic cmd Ar command
62 The command the user is allowed or denied to run.
63 The default is all commands.
64 Be advised that it's best to specify absolute paths.
65 .El
66 .Pp
67 The last matching rule determines the action taken.
68 .Sh EXAMPLES
69 The following example permits users in group wheel to execute commands as root,
70 and additionally permits tedu to run procmap as root without a password.
71 .Bd -literal -offset indent
72 permit :wheel
73 permit nopass tedu cmd /usr/sbin/procmap
74 .Ed
75 .Sh SEE ALSO
76 .Xr doas 1
77 .Sh HISTORY
78 The
79 .Nm
80 configuration file first appeared in
81 .Ox 5.8 .
82 .Sh AUTHORS
83 .An Ted Unangst Aq Mt tedu@openbsd.org