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