Updated license file.
[doas.git] / doas.1
blob7a61144b9e105391b3855dd141f51f89f91a875e
1 .\" $OpenBSD: doas.1,v 1.16 2016/06/11 04:38:21 tedu 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: June 11 2016 $
17 .Dt DOAS 1
18 .Os
19 .Sh NAME
20 .Nm doas
21 .Nd execute commands as another user
22 .Sh SYNOPSIS
23 .Nm doas
24 .Op Fl ns
25 .Op Fl a Ar style
26 .Op Fl C Ar config
27 .Op Fl u Ar user
28 .Op Fl -
29 .Ar command
30 .Op Ar args
31 .Sh DESCRIPTION
32 The
33 .Nm
34 utility executes the given command as another user.
35 The
36 .Ar command
37 argument is mandatory unless
38 .Fl C
40 .Fl s
41 is specified.
42 .Pp
43 The options are as follows:
44 .Bl -tag -width tenletters
45 .It Fl a Ar style
46 Use the specified authentication style when validating the user,
47 as allowed by
48 .Pa /etc/login.conf .
49 A list of doas-specific authentication methods may be configured by adding an
50 .Sq auth-doas
51 entry in
52 .Xr login.conf 5 .
53 .It Fl C Ar config
54 Parse and check the configuration file
55 .Ar config ,
56 then exit.
58 .Ar command
59 is supplied,
60 .Nm
61 will also perform command matching.
62 In the latter case
63 either
64 .Sq permit ,
65 .Sq permit nopass
67 .Sq deny
68 will be printed on standard output, depending on command
69 matching results.
70 No command is executed.
71 .It Fl n
72 Non interactive mode, fail if
73 .Nm
74 would prompt for password.
75 .It Fl s
76 Execute the shell from
77 .Ev SHELL
79 .Pa /etc/passwd .
80 .It Fl u Ar user
81 Execute the command as
82 .Ar user .
83 The default is root.
84 .It Fl -
85 Any dashes after a combined double dash (--) will be interpreted as part of the command to be run or its paramters. Not an argument passed to doas itself.
86 .El
87 .Sh EXIT STATUS
88 .Ex -std doas
89 It may fail for one of the following reasons:
90 .Pp
91 .Bl -bullet -compact
92 .It
93 The config file
94 .Pa /usr/local/etc/doas.conf
95 could not be parsed.
96 .It
97 The user attempted to run a command which is not permitted.
98 .It
99 The password was incorrect.
101 The specified command was not found or is not executable.
103 .Sh SEE ALSO
104 .Xr su 1 ,
105 .Xr doas.conf 5
106 .Sh HISTORY
109 command first appeared in
110 .Ox 5.8 .
111 .Sh AUTHORS
112 .An Ted Unangst Aq Mt tedu@openbsd.org