Merge branch 'upstream'
[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.21 2008/05/08 19:48:24 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@ "May  8, 2008" "1.6.9p16" "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.  
169 On Debian systems, this list defaults to /usr/bin/editor, which is meant to
170 be a system-wide default editor chosen through the alternatives system.
171 Normally, \&\fBvisudo\fR does not honor the \f(CW\*(C`VISUAL\*(C'\fR or 
172 \f(CW\*(C`EDITOR\*(C'\fR environment
173 variables unless they contain an editor in the aforementioned editors
174 list.  However, if \fBvisudo\fR is configured with the \fI\-\-with\-enveditor\fR
175 flag or the \fIenv_editor\fR \f(CW\*(C`Default\*(C'\fR variable is set in \fIsudoers\fR,
176 \&\fBvisudo\fR will use any the editor defines by \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
177 Note that this can be a security hole since it allows the user to
178 execute any program they wish simply by setting \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
179 Despite this potential risk, sudo on Debian is compiled with the
180 \fI\-\-with\-enveditor\fR flag.
181 .PP
182 \&\fBvisudo\fR parses the \fIsudoers\fR file after the edit and will
183 not save the changes if there is a syntax error.  Upon finding
184 an error, \fBvisudo\fR will print a message stating the line number(s)
185 where the error occurred and the user will receive the
186 \&\*(L"What now?\*(R" prompt.  At this point the user may enter \*(L"e\*(R"
187 to re-edit the \fIsudoers\fR file, \*(L"x\*(R" to exit without
188 saving the changes, or \*(L"Q\*(R" to quit and save changes.  The
189 \&\*(L"Q\*(R" option should be used with extreme care because if \fBvisudo\fR
190 believes there to be a parse error, so will \fBsudo\fR and no one
191 will be able to \fBsudo\fR again until the error is fixed.
192 If \*(L"e\*(R" is typed to edit the  \fIsudoers\fR file after a parse error
193 has been detected, the cursor will be placed on the line where the
194 error occurred (if the editor supports this feature).
195 .SH "OPTIONS"
196 .IX Header "OPTIONS"
197 \&\fBvisudo\fR accepts the following command line options:
198 .IP "\-c" 4
199 .IX Item "-c"
200 Enable \fBcheck-only\fR mode.  The existing \fIsudoers\fR file will be
201 checked for syntax and a message will be printed to the
202 standard output detailing the status of \fIsudoers\fR.
203 If the syntax check completes successfully, \fBvisudo\fR will
204 exit with a value of 0.  If a syntax error is encountered,
205 \&\fBvisudo\fR will exit with a value of 1.
206 .IP "\-f" 4
207 .IX Item "-f"
208 Specify and alternate \fIsudoers\fR file location.  With this option
209 \&\fBvisudo\fR will edit (or check) the \fIsudoers\fR file of your choice,
210 instead of the default, \fI@sysconfdir@/sudoers\fR.  The lock file used
211 is the specified \fIsudoers\fR file with \*(L".tmp\*(R" appended to it.
212 .IP "\-q" 4
213 .IX Item "-q"
214 Enable \fBquiet\fR mode.  In this mode details about syntax errors
215 are not printed.  This option is only useful when combined with
216 the \fB\-c\fR flag.
217 .IP "\-s" 4
218 .IX Item "-s"
219 Enable \fBstrict\fR checking of the \fIsudoers\fR file.  If an alias is
220 used before it is defined, \fBvisudo\fR will consider this a parse
221 error.  Note that it is not possible to differentiate between an
222 alias and a hostname or username that consists solely of uppercase
223 letters, digits, and the underscore ('_') character.
224 .IP "\-V" 4
225 .IX Item "-V"
226 The \fB\-V\fR (version) option causes \fBvisudo\fR to print its version number
227 and exit.
228 .SH "ENVIRONMENT"
229 .IX Header "ENVIRONMENT"
230 The following environment variables are used only if \fBvisudo\fR
231 was configured with the \fI\-\-with\-env\-editor\fR option:
232 .ie n .IP "\*(C`VISUAL\*(C'" 16
233 .el .IP "\f(CW\*(C`VISUAL\*(C'\fR" 16
234 .IX Item "VISUAL"
235 Invoked by visudo as the editor to use
236 .ie n .IP "\*(C`EDITOR\*(C'" 16
237 .el .IP "\f(CW\*(C`EDITOR\*(C'\fR" 16
238 .IX Item "EDITOR"
239 Used by visudo if \s-1VISUAL\s0 is not set
240 .SH "FILES"
241 .IX Header "FILES"
242 .IP "\fI@sysconfdir@/sudoers\fR" 24
243 .IX Item "@sysconfdir@/sudoers"
244 List of who can run what
245 .IP "\fI@sysconfdir@/sudoers.tmp\fR" 24
246 .IX Item "@sysconfdir@/sudoers.tmp"
247 Lock file for visudo
248 .SH "DIAGNOSTICS"
249 .IX Header "DIAGNOSTICS"
250 .IP "sudoers file busy, try again later." 4
251 .IX Item "sudoers file busy, try again later."
252 Someone else is currently editing the \fIsudoers\fR file.
253 .IP "@sysconfdir@/sudoers.tmp: Permission denied" 4
254 .IX Item "@sysconfdir@/sudoers.tmp: Permission denied"
255 You didn't run \fBvisudo\fR as root.
256 .IP "Can't find you in the passwd database" 4
257 .IX Item "Can't find you in the passwd database"
258 Your userid does not appear in the system passwd file.
259 .IP "Warning: undeclared Alias referenced near ..." 4
260 .IX Item "Warning: undeclared Alias referenced near ..."
261 Either you are using a {User,Runas,Host,Cmnd}_Alias before
262 defining it or you have a user or hostname listed that
263 consists solely of uppercase letters, digits, and the
264 underscore ('_') character.  If the latter, you can ignore
265 the warnings (\fBsudo\fR will not complain).  In \fB\-s\fR (strict)
266 mode these are errors, not warnings.
267 .IP "Warning: runas_default set after old value is in use ..." 4
268 .IX Item "Warning: runas_default set after old value is in use ..."
269 You have a \fIrunas_default\fR Defaults setting listed in the \fIsudoers\fR
270 file after its value has already been used.  This means that entries
271 prior to the \fIrunas_default\fR setting will match based on the default
272 value of \fIrunas_default\fR (\f(CW\*(C`@runas_default@\*(C'\fR) whereas entries
273 \&\fBafter\fR the \fIrunas_default\fR setting will match based on the new
274 value.  This is usually unintentional and in most cases the
275 <runas_default> setting should be placed before any \f(CW\*(C`Runas_Alias\*(C'\fR
276 or User specifications.  In \fB\-s\fR (strict) mode this is an error,
277 not a warning.
278 .SH "SEE ALSO"
279 .IX Header "SEE ALSO"
280 \&\fIvi\fR\|(1), \fIsudoers\fR\|(@mansectform@), \fIsudo\fR\|(@mansectsu@), \fIvipw\fR\|(8)
281 .SH "AUTHOR"
282 .IX Header "AUTHOR"
283 Many people have worked on \fIsudo\fR over the years; this version of
284 \&\fBvisudo\fR was written by:
285 .PP
286 .Vb 1
287 \& Todd Miller
288 .Ve
289 .PP
290 See the \s-1HISTORY\s0 file in the sudo distribution or visit
291 http://www.sudo.ws/sudo/history.html for more details.
292 .SH "CAVEATS"
293 .IX Header "CAVEATS"
294 There is no easy way to prevent a user from gaining a root shell if 
295 the editor used by \fBvisudo\fR allows shell escapes.
296 .SH "BUGS"
297 .IX Header "BUGS"
298 If you feel you have found a bug in \fBvisudo\fR, please submit a bug report
299 at http://www.sudo.ws/sudo/bugs/
300 .SH "SUPPORT"
301 .IX Header "SUPPORT"
302 Limited free support is available via the sudo-users mailing list,
303 see http://www.sudo.ws/mailman/listinfo/sudo\-users to subscribe or
304 search the archives.
305 .SH "DISCLAIMER"
306 .IX Header "DISCLAIMER"
307 \&\fBvisudo\fR is provided ``\s-1AS\s0 \s-1IS\s0'' and any express or implied warranties,
308 including, but not limited to, the implied warranties of merchantability
309 and fitness for a particular purpose are disclaimed.  See the \s-1LICENSE\s0
310 file distributed with \fBsudo\fR or http://www.sudo.ws/sudo/license.html
311 for complete details.