Imported Upstream version 1.7.0
[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.32 2008/11/15 18:34:26 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@ "November 15, 2008" "1.7.0" "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.  This list defaults to the path to \fIvi\fR\|(1) on
177 your system, as determined by the \fIconfigure\fR script.  Normally,
178 \&\fBvisudo\fR does not honor the \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR environment
179 variables unless they contain an editor in the aforementioned editors
180 list.  However, if \fBvisudo\fR is configured with the \fI\-\-with\-enveditor\fR
181 option or the \fIenv_editor\fR \f(CW\*(C`Default\*(C'\fR variable is set in \fIsudoers\fR,
182 \&\fBvisudo\fR will use any the editor defines by \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
183 Note that this can be a security hole since it allows the user to
184 execute any program they wish simply by setting \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
185 .PP
186 \&\fBvisudo\fR parses the \fIsudoers\fR file after the edit and will
187 not save the changes if there is a syntax error.  Upon finding
188 an error, \fBvisudo\fR will print a message stating the line number(s)
189 where the error occurred and the user will receive the
190 \&\*(L"What now?\*(R" prompt.  At this point the user may enter \*(L"e\*(R"
191 to re-edit the \fIsudoers\fR file, \*(L"x\*(R" to exit without
192 saving the changes, or \*(L"Q\*(R" to quit and save changes.  The
193 \&\*(L"Q\*(R" option should be used with extreme care because if \fBvisudo\fR
194 believes there to be a parse error, so will \fBsudo\fR and no one
195 will be able to \fBsudo\fR again until the error is fixed.
196 If \*(L"e\*(R" is typed to edit the  \fIsudoers\fR file after a parse error
197 has been detected, the cursor will be placed on the line where the
198 error occurred (if the editor supports this feature).
199 .SH "OPTIONS"
200 .IX Header "OPTIONS"
201 \&\fBvisudo\fR accepts the following command line options:
202 .IP "\-c" 12
203 .IX Item "-c"
204 Enable \fBcheck-only\fR mode.  The existing \fIsudoers\fR file will be
205 checked for syntax and a message will be printed to the
206 standard output detailing the status of \fIsudoers\fR.
207 If the syntax check completes successfully, \fBvisudo\fR will
208 exit with a value of 0.  If a syntax error is encountered,
209 \&\fBvisudo\fR will exit with a value of 1.
210 .IP "\-f \fIsudoers\fR" 12
211 .IX Item "-f sudoers"
212 Specify and alternate \fIsudoers\fR file location.  With this option
213 \&\fBvisudo\fR will edit (or check) the \fIsudoers\fR file of your choice,
214 instead of the default, \fI\f(CI@sysconfdir\fI@/sudoers\fR.  The lock file used
215 is the specified \fIsudoers\fR file with \*(L".tmp\*(R" appended to it.
216 .IP "\-q" 12
217 .IX Item "-q"
218 Enable \fBquiet\fR mode.  In this mode details about syntax errors
219 are not printed.  This option is only useful when combined with
220 the \fB\-c\fR option.
221 .IP "\-s" 12
222 .IX Item "-s"
223 Enable \fBstrict\fR checking of the \fIsudoers\fR file.  If an alias is
224 used before it is defined, \fBvisudo\fR will consider this a parse
225 error.  Note that it is not possible to differentiate between an
226 alias and a hostname or username that consists solely of uppercase
227 letters, digits, and the underscore ('_') character.
228 .IP "\-V" 12
229 .IX Item "-V"
230 The \fB\-V\fR (version) option causes \fBvisudo\fR to print its version number
231 and exit.
232 .SH "ENVIRONMENT"
233 .IX Header "ENVIRONMENT"
234 The following environment variables may be consulted depending on
235 the value of the \fIeditor\fR and \fIenv_editor\fR \fIsudoers\fR variables:
236 .ie n .IP "\*(C`VISUAL\*(C'" 16
237 .el .IP "\f(CW\*(C`VISUAL\*(C'\fR" 16
238 .IX Item "VISUAL"
239 Invoked by visudo as the editor to use
240 .ie n .IP "\*(C`EDITOR\*(C'" 16
241 .el .IP "\f(CW\*(C`EDITOR\*(C'\fR" 16
242 .IX Item "EDITOR"
243 Used by visudo if \s-1VISUAL\s0 is not set
244 .SH "FILES"
245 .IX Header "FILES"
246 .ie n .IP "\fI\fI@sysconfdir\fI@/sudoers\fR" 24
247 .el .IP "\fI\f(CI@sysconfdir\fI@/sudoers\fR" 24
248 .IX Item "@sysconfdir@/sudoers"
249 List of who can run what
250 .ie n .IP "\fI\fI@sysconfdir\fI@/sudoers.tmp\fR" 24
251 .el .IP "\fI\f(CI@sysconfdir\fI@/sudoers.tmp\fR" 24
252 .IX Item "@sysconfdir@/sudoers.tmp"
253 Lock file for visudo
254 .SH "DIAGNOSTICS"
255 .IX Header "DIAGNOSTICS"
256 .IP "sudoers file busy, try again later." 4
257 .IX Item "sudoers file busy, try again later."
258 Someone else is currently editing the \fIsudoers\fR file.
259 .ie n .IP "@sysconfdir@/sudoers.tmp: Permission denied" 4
260 .el .IP "\f(CW@sysconfdir\fR@/sudoers.tmp: Permission denied" 4
261 .IX Item "@sysconfdir@/sudoers.tmp: Permission denied"
262 You didn't run \fBvisudo\fR as root.
263 .IP "Can't find you in the passwd database" 4
264 .IX Item "Can't find you in the passwd database"
265 Your userid does not appear in the system passwd file.
266 .IP "Warning: {User,Runas,Host,Cmnd}_Alias referenced but not defined" 4
267 .IX Item "Warning: {User,Runas,Host,Cmnd}_Alias referenced but not defined"
268 Either you are trying to use an undeclare {User,Runas,Host,Cmnd}_Alias
269 or you have a user or hostname listed that consists solely of
270 uppercase letters, digits, and the underscore ('_') character.  In
271 the latter case, you can ignore the warnings (\fBsudo\fR will not
272 complain).  In \fB\-s\fR (strict) mode these are errors, not warnings.
273 .IP "Warning: unused {User,Runas,Host,Cmnd}_Alias" 4
274 .IX Item "Warning: unused {User,Runas,Host,Cmnd}_Alias"
275 The specified {User,Runas,Host,Cmnd}_Alias was defined but never
276 used.  You may wish to comment out or remove the unused alias.  In
277 \&\fB\-s\fR (strict) mode this is an error, 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.