update init.d to clean new state location /var/lib/sudo, prepare to upload
[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 .\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
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@ "June  1, 2010" "1.7.2p7" "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\-c\fR] [\fB\-q\fR] [\fB\-s\fR] [\fB\-V\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 editors that \fBvisudo\fR will use set
166 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 the path to \fIvi\fR\|(1) on
168 your system, as determined by the \fIconfigure\fR script.  Normally,
169 \&\fBvisudo\fR does not honor the \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR environment
170 variables unless they contain an editor in the aforementioned editors
171 list.  However, if \fBvisudo\fR is configured with the \fI\-\-with\-enveditor\fR
172 option or the \fIenv_editor\fR \f(CW\*(C`Default\*(C'\fR variable is set in \fIsudoers\fR,
173 \&\fBvisudo\fR will use any the editor defines by \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
174 Note that this can be a security hole since it allows the user to
175 execute any program they wish simply by setting \f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR.
176 .PP
177 \&\fBvisudo\fR parses the \fIsudoers\fR file after the edit and will
178 not save the changes if there is a syntax error.  Upon finding
179 an error, \fBvisudo\fR will print a message stating the line number(s)
180 where the error occurred and the user will receive the
181 \&\*(L"What now?\*(R" prompt.  At this point the user may enter \*(L"e\*(R"
182 to re-edit the \fIsudoers\fR file, \*(L"x\*(R" to exit without
183 saving the changes, or \*(L"Q\*(R" to quit and save changes.  The
184 \&\*(L"Q\*(R" option should be used with extreme care because if \fBvisudo\fR
185 believes there to be a parse error, so will \fBsudo\fR and no one
186 will be able to \fBsudo\fR again until the error is fixed.
187 If \*(L"e\*(R" is typed to edit the  \fIsudoers\fR file after a parse error
188 has been detected, the cursor will be placed on the line where the
189 error occurred (if the editor supports this feature).
190 .SH "OPTIONS"
191 .IX Header "OPTIONS"
192 \&\fBvisudo\fR accepts the following command line options:
193 .IP "\-c" 12
194 .IX Item "-c"
195 Enable \fBcheck-only\fR mode.  The existing \fIsudoers\fR file will be
196 checked for syntax and a message will be printed to the
197 standard output detailing the status of \fIsudoers\fR.
198 If the syntax check completes successfully, \fBvisudo\fR will
199 exit with a value of 0.  If a syntax error is encountered,
200 \&\fBvisudo\fR will exit with a value of 1.
201 .IP "\-f \fIsudoers\fR" 12
202 .IX Item "-f sudoers"
203 Specify and alternate \fIsudoers\fR file location.  With this option
204 \&\fBvisudo\fR will edit (or check) the \fIsudoers\fR file of your choice,
205 instead of the default, \fI@sysconfdir@/sudoers\fR.  The lock file used
206 is the specified \fIsudoers\fR file with \*(L".tmp\*(R" appended to it.
207 .IP "\-q" 12
208 .IX Item "-q"
209 Enable \fBquiet\fR mode.  In this mode details about syntax errors
210 are not printed.  This option is only useful when combined with
211 the \fB\-c\fR option.
212 .IP "\-s" 12
213 .IX Item "-s"
214 Enable \fBstrict\fR checking of the \fIsudoers\fR file.  If an alias is
215 used before it is defined, \fBvisudo\fR will consider this a parse
216 error.  Note that it is not possible to differentiate between an
217 alias and a hostname or username that consists solely of uppercase
218 letters, digits, and the underscore ('_') character.
219 .IP "\-V" 12
220 .IX Item "-V"
221 The \fB\-V\fR (version) option causes \fBvisudo\fR to print its version number
222 and exit.
223 .SH "ENVIRONMENT"
224 .IX Header "ENVIRONMENT"
225 The following environment variables may be consulted depending on
226 the value of the \fIeditor\fR and \fIenv_editor\fR \fIsudoers\fR variables:
227 .ie n .IP "\*(C`VISUAL\*(C'" 16
228 .el .IP "\f(CW\*(C`VISUAL\*(C'\fR" 16
229 .IX Item "VISUAL"
230 Invoked by visudo as the editor to use
231 .ie n .IP "\*(C`EDITOR\*(C'" 16
232 .el .IP "\f(CW\*(C`EDITOR\*(C'\fR" 16
233 .IX Item "EDITOR"
234 Used by visudo if \s-1VISUAL\s0 is not set
235 .SH "FILES"
236 .IX Header "FILES"
237 .ie n .IP "\fI@sysconfdir@/sudoers\fR" 24
238 .el .IP "\fI@sysconfdir@/sudoers\fR" 24
239 .IX Item "@sysconfdir@/sudoers"
240 List of who can run what
241 .ie n .IP "\fI@sysconfdir@/sudoers.tmp\fR" 24
242 .el .IP "\fI@sysconfdir@/sudoers.tmp\fR" 24
243 .IX Item "@sysconfdir@/sudoers.tmp"
244 Lock file for visudo
245 .SH "DIAGNOSTICS"
246 .IX Header "DIAGNOSTICS"
247 .IP "sudoers file busy, try again later." 4
248 .IX Item "sudoers file busy, try again later."
249 Someone else is currently editing the \fIsudoers\fR file.
250 .ie n .IP "@sysconfdir@/sudoers.tmp: Permission denied" 4
251 .el .IP "\f(CW@sysconfdir\fR@/sudoers.tmp: Permission denied" 4
252 .IX Item "@sysconfdir@/sudoers.tmp: Permission denied"
253 You didn't run \fBvisudo\fR as root.
254 .IP "Can't find you in the passwd database" 4
255 .IX Item "Can't find you in the passwd database"
256 Your userid does not appear in the system passwd file.
257 .IP "Warning: {User,Runas,Host,Cmnd}_Alias referenced but not defined" 4
258 .IX Item "Warning: {User,Runas,Host,Cmnd}_Alias referenced but not defined"
259 Either you are trying to use an undeclare {User,Runas,Host,Cmnd}_Alias
260 or you have a user or hostname listed that consists solely of
261 uppercase letters, digits, and the underscore ('_') character.  In
262 the latter case, you can ignore the warnings (\fBsudo\fR will not
263 complain).  In \fB\-s\fR (strict) mode these are errors, not warnings.
264 .IP "Warning: unused {User,Runas,Host,Cmnd}_Alias" 4
265 .IX Item "Warning: unused {User,Runas,Host,Cmnd}_Alias"
266 The specified {User,Runas,Host,Cmnd}_Alias was defined but never
267 used.  You may wish to comment out or remove the unused alias.  In
268 \&\fB\-s\fR (strict) mode this is an error, not a warning.
269 .SH "SEE ALSO"
270 .IX Header "SEE ALSO"
271 \&\fIvi\fR\|(1), \fIsudoers\fR\|(@mansectform@), \fIsudo\fR\|(@mansectsu@), \fIvipw\fR\|(8)
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 Limited free support is available via the sudo-users mailing list,
294 see http://www.sudo.ws/mailman/listinfo/sudo\-users to subscribe or
295 search the archives.
296 .SH "DISCLAIMER"
297 .IX Header "DISCLAIMER"
298 \&\fBvisudo\fR is provided ``\s-1AS\s0 \s-1IS\s0'' and any express or implied warranties,
299 including, but not limited to, the implied warranties of merchantability
300 and fitness for a particular purpose are disclaimed.  See the \s-1LICENSE\s0
301 file distributed with \fBsudo\fR or http://www.sudo.ws/sudo/license.html
302 for complete details.