Imported Upstream version 1.6.9p6
[debian/sudo] / visudo.man.in
1 .\" Copyright (c) 1996,1998-2005, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
2 .\" 
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
6 .\" 
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 .\" 
16 .\" Sponsored in part by the Defense Advanced Research Projects
17 .\" Agency (DARPA) and Air Force Research Laboratory, Air Force
18 .\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
19 .\" 
20 .\" $Sudo: visudo.man.in,v 1.20.2.11 2007/10/09 13:30:48 millert Exp $
21 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
22 .\"
23 .\" Standard preamble:
24 .\" ========================================================================
25 .de Sh \" Subsection heading
26 .br
27 .if t .Sp
28 .ne 5
29 .PP
30 \fB\\$1\fR
31 .PP
32 ..
33 .de Sp \" Vertical space (when we can't use .PP)
34 .if t .sp .5v
35 .if n .sp
36 ..
37 .de Vb \" Begin verbatim text
38 .ft CW
39 .nf
40 .ne \\$1
41 ..
42 .de Ve \" End verbatim text
43 .ft R
44 .fi
45 ..
46 .\" Set up some character translations and predefined strings.  \*(-- will
47 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
48 .\" double quote, and \*(R" will give a right double quote.  | will give a
49 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
50 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
51 .\" expand to `' in nroff, nothing in troff, for use with C<>.
52 .tr \(*W-|\(bv\*(Tr
53 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
54 .ie n \{\
55 .    ds -- \(*W-
56 .    ds PI pi
57 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
58 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
59 .    ds L" ""
60 .    ds R" ""
61 .    ds C` 
62 .    ds C' 
63 'br\}
64 .el\{\
65 .    ds -- \|\(em\|
66 .    ds PI \(*p
67 .    ds L" ``
68 .    ds R" ''
69 'br\}
70 .\"
71 .\" If the F register is turned on, we'll generate index entries on stderr for
72 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
73 .\" entries marked with X<> in POD.  Of course, you'll have to process the
74 .\" output yourself in some meaningful fashion.
75 .if \nF \{\
76 .    de IX
77 .    tm Index:\\$1\t\\n%\t"\\$2"
78 ..
79 .    nr % 0
80 .    rr F
81 .\}
82 .\"
83 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
84 .\" way too many mistakes in technical documents.
85 .hy 0
86 .if n .na
87 .\"
88 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
89 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
90 .    \" fudge factors for nroff and troff
91 .if n \{\
92 .    ds #H 0
93 .    ds #V .8m
94 .    ds #F .3m
95 .    ds #[ \f1
96 .    ds #] \fP
97 .\}
98 .if t \{\
99 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
100 .    ds #V .6m
101 .    ds #F 0
102 .    ds #[ \&
103 .    ds #] \&
104 .\}
105 .    \" simple accents for nroff and troff
106 .if n \{\
107 .    ds ' \&
108 .    ds ` \&
109 .    ds ^ \&
110 .    ds , \&
111 .    ds ~ ~
112 .    ds /
113 .\}
114 .if t \{\
115 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
116 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
117 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
118 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
119 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
120 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
121 .\}
122 .    \" troff and (daisy-wheel) nroff accents
123 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
124 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
125 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
126 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
127 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
128 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
129 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
130 .ds ae a\h'-(\w'a'u*4/10)'e
131 .ds Ae A\h'-(\w'A'u*4/10)'E
132 .    \" corrections for vroff
133 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
134 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
135 .    \" for low resolution devices (crt and lpr)
136 .if \n(.H>23 .if \n(.V>19 \
137 \{\
138 .    ds : e
139 .    ds 8 ss
140 .    ds o a
141 .    ds d- d\h'-1'\(ga
142 .    ds D- D\h'-1'\(hy
143 .    ds th \o'bp'
144 .    ds Th \o'LP'
145 .    ds ae ae
146 .    ds Ae AE
147 .\}
148 .rm #[ #] #H #V #F C
149 .\" ========================================================================
150 .\"
151 .IX Title "VISUDO @mansectsu@"
152 .TH VISUDO @mansectsu@ "October  9, 2007" "1.6.9p6" "MAINTENANCE COMMANDS"
153 .SH "NAME"
154 visudo \- edit the sudoers file
155 .SH "SYNOPSIS"
156 .IX Header "SYNOPSIS"
157 \&\fBvisudo\fR [\fB\-c\fR] [\fB\-q\fR] [\fB\-s\fR] [\fB\-V\fR] [\fB\-f\fR \fIsudoers\fR]
158 .SH "DESCRIPTION"
159 .IX Header "DESCRIPTION"
160 \&\fBvisudo\fR edits the \fIsudoers\fR file in a safe fashion, analogous to
161 \&\fIvipw\fR\|(@mansectsu@).  \fBvisudo\fR locks the \fIsudoers\fR file against multiple
162 simultaneous edits, provides basic sanity checks, and checks
163 for parse errors.  If the \fIsudoers\fR file is currently being
164 edited you will receive a message to try again later.
165 .PP
166 There is a hard-coded list of editors that \fBvisudo\fR will use set
167 at compile-time that may be overridden via the \fIeditor\fR \fIsudoers\fR
168 \&\f(CW\*(C`Default\*(C'\fR variable.  This list defaults to the path to \fIvi\fR\|(1) on
169 your system, as determined by the \fIconfigure\fR script.  Normally,
170 \&\fBvisudo\fR does not honor the \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR environment
171 variables unless they contain an editor in the aforementioned editors
172 list.  However, if \fBvisudo\fR is configured with the \fI\-\-with\-enveditor\fR
173 flag or the \fIenv_editor\fR \f(CW\*(C`Default\*(C'\fR variable is set in \fIsudoers\fR,
174 \&\fBvisudo\fR will use any the editor defines by \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
175 Note that this can be a security hole since it allows the user to
176 execute any program they wish simply by setting \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
177 .PP
178 \&\fBvisudo\fR parses the \fIsudoers\fR file after the edit and will
179 not save the changes if there is a syntax error.  Upon finding
180 an error, \fBvisudo\fR will print a message stating the line number(s)
181 where the error occurred and the user will receive the
182 \&\*(L"What now?\*(R" prompt.  At this point the user may enter \*(L"e\*(R"
183 to re-edit the \fIsudoers\fR file, \*(L"x\*(R" to exit without
184 saving the changes, or \*(L"Q\*(R" to quit and save changes.  The
185 \&\*(L"Q\*(R" option should be used with extreme care because if \fBvisudo\fR
186 believes there to be a parse error, so will \fBsudo\fR and no one
187 will be able to \fBsudo\fR again until the error is fixed.
188 If \*(L"e\*(R" is typed to edit the  \fIsudoers\fR file after a parse error
189 has been detected, the cursor will be placed on the line where the
190 error occurred (if the editor supports this feature).
191 .SH "OPTIONS"
192 .IX Header "OPTIONS"
193 \&\fBvisudo\fR accepts the following command line options:
194 .IP "\-c" 4
195 .IX Item "-c"
196 Enable \fBcheck-only\fR mode.  The existing \fIsudoers\fR file will be
197 checked for syntax and a message will be printed to the
198 standard output detailing the status of \fIsudoers\fR.
199 If the syntax check completes successfully, \fBvisudo\fR will
200 exit with a value of 0.  If a syntax error is encountered,
201 \&\fBvisudo\fR will exit with a value of 1.
202 .IP "\-f" 4
203 .IX Item "-f"
204 Specify and alternate \fIsudoers\fR file location.  With this option
205 \&\fBvisudo\fR will edit (or check) the \fIsudoers\fR file of your choice,
206 instead of the default, \fI@sysconfdir@/sudoers\fR.  The lock file used
207 is the specified \fIsudoers\fR file with \*(L".tmp\*(R" appended to it.
208 .IP "\-q" 4
209 .IX Item "-q"
210 Enable \fBquiet\fR mode.  In this mode details about syntax errors
211 are not printed.  This option is only useful when combined with
212 the \fB\-c\fR flag.
213 .IP "\-s" 4
214 .IX Item "-s"
215 Enable \fBstrict\fR checking of the \fIsudoers\fR file.  If an alias is
216 used before it is defined, \fBvisudo\fR will consider this a parse
217 error.  Note that it is not possible to differentiate between an
218 alias and a hostname or username that consists solely of uppercase
219 letters, digits, and the underscore ('_') character.
220 .IP "\-V" 4
221 .IX Item "-V"
222 The \fB\-V\fR (version) option causes \fBvisudo\fR to print its version number
223 and exit.
224 .SH "ENVIRONMENT"
225 .IX Header "ENVIRONMENT"
226 The following environment variables are used only if \fBvisudo\fR
227 was configured with the \fI\-\-with\-env\-editor\fR option:
228 .ie n .IP "\*(C`VISUAL\*(C'" 16
229 .el .IP "\f(CW\*(C`VISUAL\*(C'\fR" 16
230 .IX Item "VISUAL"
231 Invoked by visudo as the editor to use
232 .ie n .IP "\*(C`EDITOR\*(C'" 16
233 .el .IP "\f(CW\*(C`EDITOR\*(C'\fR" 16
234 .IX Item "EDITOR"
235 Used by visudo if \s-1VISUAL\s0 is not set
236 .SH "FILES"
237 .IX Header "FILES"
238 .ie n .IP "\fI@sysconfdir@/sudoers\fR\*(C`              \*(C'List of who can run what" 4
239 .el .IP "\fI@sysconfdir@/sudoers\fR\f(CW\*(C`                   \*(C'\fRList of who can run what" 4
240 .IX Item "@sysconfdir@/sudoers                  List of who can run what"
241 .PD 0
242 .ie n .IP "\fI@sysconfdir@/sudoers.tmp\fR\*(C`          \*(C'Lock file for visudo" 4
243 .el .IP "\fI@sysconfdir@/sudoers.tmp\fR\f(CW\*(C`               \*(C'\fRLock file for visudo" 4
244 .IX Item "@sysconfdir@/sudoers.tmp              Lock file for visudo"
245 .PD
246 .SH "DIAGNOSTICS"
247 .IX Header "DIAGNOSTICS"
248 .IP "sudoers file busy, try again later." 4
249 .IX Item "sudoers file busy, try again later."
250 Someone else is currently editing the \fIsudoers\fR file.
251 .IP "@sysconfdir@/sudoers.tmp: Permission denied" 4
252 .IX Item "@sysconfdir@/sudoers.tmp: Permission denied"
253 You didn't run \fBvisudo\fR as root.
254 .IP "Can't find you in the passwd database" 4
255 .IX Item "Can't find you in the passwd database"
256 Your userid does not appear in the system passwd file.
257 .IP "Warning: undeclared Alias referenced near ..." 4
258 .IX Item "Warning: undeclared Alias referenced near ..."
259 Either you are using a {User,Runas,Host,Cmnd}_Alias before
260 defining it or you have a user or hostname listed that
261 consists solely of uppercase letters, digits, and the
262 underscore ('_') character.  If the latter, you can ignore
263 the warnings (\fBsudo\fR will not complain).  In \fB\-s\fR (strict)
264 mode these are errors, not warnings.
265 .IP "Warning: runas_default set after old value is in use ..." 4
266 .IX Item "Warning: runas_default set after old value is in use ..."
267 You have a \fIrunas_default\fR Defaults setting listed in the \fIsudoers\fR
268 file after its value has already been used.  This means that entries
269 prior to the \fIrunas_default\fR setting will match based on the default
270 value of \fIrunas_default\fR (\f(CW\*(C`@runas_default@\*(C'\fR) whereas entries
271 \&\fBafter\fR the \fIrunas_default\fR setting will match based on the new
272 value.  This is usually unintentional and in most cases the
273 <runas_default> setting should be placed before any \f(CW\*(C`Runas_Alias\*(C'\fR
274 or User specifications.  In \fB\-s\fR (strict) mode this is an error,
275 not a warning.
276 .SH "SEE ALSO"
277 .IX Header "SEE ALSO"
278 \&\fIvi\fR\|(1), \fIsudoers\fR\|(@mansectform@), \fIsudo\fR\|(@mansectsu@), \fIvipw\fR\|(8)
279 .SH "AUTHOR"
280 .IX Header "AUTHOR"
281 Many people have worked on \fIsudo\fR over the years; this version of
282 \&\fBvisudo\fR was written by:
283 .PP
284 .Vb 1
285 \& Todd Miller
286 .Ve
287 .PP
288 See the \s-1HISTORY\s0 file in the sudo distribution or visit
289 http://www.sudo.ws/sudo/history.html for more details.
290 .SH "CAVEATS"
291 .IX Header "CAVEATS"
292 There is no easy way to prevent a user from gaining a root shell if 
293 the editor used by \fBvisudo\fR allows shell escapes.
294 .SH "BUGS"
295 .IX Header "BUGS"
296 If you feel you have found a bug in \fBvisudo\fR, please submit a bug report
297 at http://www.sudo.ws/sudo/bugs/
298 .SH "SUPPORT"
299 .IX Header "SUPPORT"
300 Limited free support is available via the sudo-users mailing list,
301 see http://www.sudo.ws/mailman/listinfo/sudo\-users to subscribe or
302 search the archives.
303 .SH "DISCLAIMER"
304 .IX Header "DISCLAIMER"
305 \&\fBvisudo\fR is provided ``\s-1AS\s0 \s-1IS\s0'' and any express or implied warranties,
306 including, but not limited to, the implied warranties of merchantability
307 and fitness for a particular purpose are disclaimed.  See the \s-1LICENSE\s0
308 file distributed with \fBsudo\fR or http://www.sudo.ws/sudo/license.html
309 for complete details.