Imported Debian patch 1.6.8p9-2
[debian/sudo] / visudo.man.in
1 .\" Copyright (c) 1996,1998-2003 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.pod,v 1.39 2004/09/06 20:45:27 millert Exp $
21 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
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@ "June 20, 2005" "1.6.8p9" "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\-f\fR \fIsudoers\fR ] [ \fB\-q\fR ] [ \fB\-s\fR ] [ \fB\-V\fR ]
158 .SH "DESCRIPTION"
159 .IX Header "DESCRIPTION"
160 \&\fBvisudo\fR edits the \fIsudoers\fR file in a safe fashion, analogous to
161 vipw(@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 \fIenveditor\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 .PP
229 .Vb 2
230 \& VISUAL                 Invoked by visudo as the editor to use
231 \& EDITOR                 Used by visudo if VISUAL is not set
232 .Ve
233 .SH "FILES"
234 .IX Header "FILES"
235 .Vb 2
236 \& @sysconfdir@/sudoers           List of who can run what
237 \& @sysconfdir@/sudoers.tmp       Lock file for visudo
238 .Ve
239 .SH "DIAGNOSTICS"
240 .IX Header "DIAGNOSTICS"
241 .IP "sudoers file busy, try again later." 4
242 .IX Item "sudoers file busy, try again later."
243 Someone else is currently editing the \fIsudoers\fR file.
244 .IP "@sysconfdir@/sudoers.tmp: Permission denied" 4
245 .IX Item "@sysconfdir@/sudoers.tmp: Permission denied"
246 You didn't run \fBvisudo\fR as root.
247 .IP "Can't find you in the passwd database" 4
248 .IX Item "Can't find you in the passwd database"
249 Your userid does not appear in the system passwd file.
250 .IP "Warning: undeclared Alias referenced near ..." 4
251 .IX Item "Warning: undeclared Alias referenced near ..."
252 Either you are using a {User,Runas,Host,Cmnd}_Alias before
253 defining it or you have a user or hostname listed that
254 consists solely of uppercase letters, digits, and the
255 underscore ('_') character.  If the latter, you can ignore
256 the warnings (\fBsudo\fR will not complain).  In \fB\-s\fR (strict)
257 mode these are errors, not warnings.
258 .IP "Warning: runas_default set after old value is in use ..." 4
259 .IX Item "Warning: runas_default set after old value is in use ..."
260 You have a \fIrunas_default\fR Defaults setting listed in the \fIsudoers\fR
261 file after its value has already been used.  This means that entries
262 prior to the \fIrunas_default\fR setting will match based on the default
263 value of \fIrunas_default\fR (\f(CW\*(C`@runas_default@\*(C'\fR) whereas entries
264 \&\fBafter\fR the \fIrunas_default\fR setting will match based on the new
265 value.  This is usually unintentional and in most cases the
266 <runas_default> setting should be placed before any \f(CW\*(C`Runas_Alias\*(C'\fR
267 or User specifications.  In \fB\-s\fR (strict) mode this is an error,
268 not a warning.
269 .SH "SEE ALSO"
270 .IX Header "SEE ALSO"
271 \&\fIvi\fR\|(1), sudoers(@mansectform@), sudo(@mansectsu@), vipw(@mansectsu@)
272 .SH "AUTHOR"
273 .IX Header "AUTHOR"
274 Many people have worked on \fIsudo\fR over the years; this version of
275 \&\fBvisudo\fR was written by:
276 .PP
277 .Vb 1
278 \& Todd Miller
279 .Ve
280 .PP
281 See the \s-1HISTORY\s0 file in the sudo distribution or visit
282 http://www.sudo.ws/sudo/history.html for more details.
283 .SH "CAVEATS"
284 .IX Header "CAVEATS"
285 There is no easy way to prevent a user from gaining a root shell if 
286 the editor used by \fBvisudo\fR allows shell escapes.
287 .SH "BUGS"
288 .IX Header "BUGS"
289 If you feel you have found a bug in \fBvisudo\fR, please submit a bug report
290 at http://www.sudo.ws/sudo/bugs/
291 .SH "SUPPORT"
292 .IX Header "SUPPORT"
293 Commercial support is available for \fBsudo\fR, see
294 http://www.sudo.ws/sudo/support.html for details.
295 .PP
296 Limited free support is available via the sudo-users mailing list,
297 see http://www.sudo.ws/mailman/listinfo/sudo\-users to subscribe or
298 search the archives.
299 .SH "DISCLAIMER"
300 .IX Header "DISCLAIMER"
301 \&\fBVisudo\fR is provided ``\s-1AS\s0 \s-1IS\s0'' and any express or implied warranties,
302 including, but not limited to, the implied warranties of merchantability
303 and fitness for a particular purpose are disclaimed.  See the \s-1LICENSE\s0
304 file distributed with \fBsudo\fR or http://www.sudo.ws/sudo/license.html
305 for complete details.