]> git.armaanb.net Git - opendoas.git/blob - doas.1
timestamp: error out if fstat and lstat st_ino and st_dev are not the same
[opendoas.git] / doas.1
1 .\" $OpenBSD: doas.1,v 1.13 2015/07/26 23:00:15 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: July 26 2015 $
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 Lns
25 .Op Fl C Ar config
26 .Op Fl u Ar user
27 .Ar command
28 .Op Ar args
29 .Sh DESCRIPTION
30 The
31 .Nm
32 utility executes the given command as another user.
33 The
34 .Ar command
35 argument is mandatory unless
36 .Fl C ,
37 .Fl L ,
38 or
39 .Fl s
40 is specified.
41 .Pp
42 The options are as follows:
43 .Bl -tag -width tenletters
44 .It Fl C Ar config
45 Parse and check the configuration file
46 .Ar config ,
47 then exit.
48 If
49 .Ar command
50 is supplied,
51 .Nm
52 will also perform command matching.
53 In the latter case
54 either
55 .Sq permit ,
56 .Sq permit nopass
57 or
58 .Sq deny
59 will be printed on standard output, depending on command
60 matching results.
61 No command is executed.
62 .It Fl L
63 Clear any persisted authorizations from previous invocations,
64 then immediately exit.
65 No command is executed.
66 .It Fl n
67 Non interactive mode, fail if
68 .Nm
69 would prompt for password.
70 .It Fl s
71 Execute the shell from
72 .Ev SHELL
73 or
74 .Pa /etc/passwd .
75 .It Fl u Ar user
76 Execute the command as
77 .Ar user .
78 The default is root.
79 .El
80 .Sh EXIT STATUS
81 .Ex -std doas
82 It may fail for one of the following reasons:
83 .Pp
84 .Bl -bullet -compact
85 .It
86 The config file
87 .Pa /etc/doas.conf
88 could not be parsed.
89 .It
90 The user attempted to run a command which is not permitted.
91 .It
92 The password was incorrect.
93 .It
94 The specified command was not found or is not executable.
95 .El
96 .Sh SEE ALSO
97 .Xr su 1 ,
98 .Xr doas.conf 5
99 .Sh HISTORY
100 The
101 .Nm
102 command first appeared in
103 .Ox 5.8 .
104 .Sh AUTHORS
105 .An Ted Unangst Aq Mt tedu@openbsd.org