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