Imported Upstream version 1.7.6p1
[debian/sudo] / sudoreplay.man.in
1 .\" Copyright (c) 2009-2010 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 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
17 .\"
18 .\" Standard preamble:
19 .\" ========================================================================
20 .de Sp \" Vertical space (when we can't use .PP)
21 .if t .sp .5v
22 .if n .sp
23 ..
24 .de Vb \" Begin verbatim text
25 .ft CW
26 .nf
27 .ne \\$1
28 ..
29 .de Ve \" End verbatim text
30 .ft R
31 .fi
32 ..
33 .\" Set up some character translations and predefined strings.  \*(-- will
34 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
35 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
36 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
37 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
38 .\" nothing in troff, for use with C<>.
39 .tr \(*W-
40 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
41 .ie n \{\
42 .    ds -- \(*W-
43 .    ds PI pi
44 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
45 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
46 .    ds L" ""
47 .    ds R" ""
48 .    ds C` 
49 .    ds C' 
50 'br\}
51 .el\{\
52 .    ds -- \|\(em\|
53 .    ds PI \(*p
54 .    ds L" ``
55 .    ds R" ''
56 'br\}
57 .\"
58 .\" Escape single quotes in literal strings from groff's Unicode transform.
59 .ie \n(.g .ds Aq \(aq
60 .el       .ds Aq '
61 .\"
62 .\" If the F register is turned on, we'll generate index entries on stderr for
63 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
64 .\" entries marked with X<> in POD.  Of course, you'll have to process the
65 .\" output yourself in some meaningful fashion.
66 .ie \nF \{\
67 .    de IX
68 .    tm Index:\\$1\t\\n%\t"\\$2"
69 ..
70 .    nr % 0
71 .    rr F
72 .\}
73 .el \{\
74 .    de IX
75 ..
76 .\}
77 .\"
78 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
79 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
80 .    \" fudge factors for nroff and troff
81 .if n \{\
82 .    ds #H 0
83 .    ds #V .8m
84 .    ds #F .3m
85 .    ds #[ \f1
86 .    ds #] \fP
87 .\}
88 .if t \{\
89 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
90 .    ds #V .6m
91 .    ds #F 0
92 .    ds #[ \&
93 .    ds #] \&
94 .\}
95 .    \" simple accents for nroff and troff
96 .if n \{\
97 .    ds ' \&
98 .    ds ` \&
99 .    ds ^ \&
100 .    ds , \&
101 .    ds ~ ~
102 .    ds /
103 .\}
104 .if t \{\
105 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
106 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
107 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
108 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
109 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
110 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
111 .\}
112 .    \" troff and (daisy-wheel) nroff accents
113 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
114 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
115 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
116 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
117 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
118 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
119 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
120 .ds ae a\h'-(\w'a'u*4/10)'e
121 .ds Ae A\h'-(\w'A'u*4/10)'E
122 .    \" corrections for vroff
123 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
124 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
125 .    \" for low resolution devices (crt and lpr)
126 .if \n(.H>23 .if \n(.V>19 \
127 \{\
128 .    ds : e
129 .    ds 8 ss
130 .    ds o a
131 .    ds d- d\h'-1'\(ga
132 .    ds D- D\h'-1'\(hy
133 .    ds th \o'bp'
134 .    ds Th \o'LP'
135 .    ds ae ae
136 .    ds Ae AE
137 .\}
138 .rm #[ #] #H #V #F C
139 .\" ========================================================================
140 .\"
141 .IX Title "SUDOREPLAY @mansectsu@"
142 .TH SUDOREPLAY @mansectsu@ "April  9, 2011" "1.7.6" "MAINTENANCE COMMANDS"
143 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
144 .\" way too many mistakes in technical documents.
145 .if n .ad l
146 .nh
147 .SH "NAME"
148 sudoreplay \- replay sudo session logs
149 .SH "SYNOPSIS"
150 .IX Header "SYNOPSIS"
151 \&\fBsudoreplay\fR [\fB\-h\fR] [\fB\-d\fR \fIdirectory\fR] [\fB\-f\fR \fIfilter\fR] [\fB\-m\fR \fImax_wait\fR] [\fB\-s\fR \fIspeed_factor\fR] \s-1ID\s0
152 .PP
153 \&\fBsudoreplay\fR [\fB\-h\fR] [\fB\-d\fR \fIdirectory\fR] \-l [search expression]
154 .SH "DESCRIPTION"
155 .IX Header "DESCRIPTION"
156 \&\fBsudoreplay\fR plays back or lists the session logs created by
157 \&\fBsudo\fR.  When replaying, \fBsudoreplay\fR can play the session back
158 in real-time, or the playback speed may be adjusted (faster or
159 slower) based on the command line options.  The \fI\s-1ID\s0\fR should be
160 a six character sequence of digits and upper case letters, e.g.
161 0100A5, which is logged by \fBsudo\fR when a command is run with
162 session logging enabled.
163 .PP
164 In list mode, \fBsudoreplay\fR can be used to find the \s-1ID\s0 of a session
165 based on a number of criteria such as the user, tty or command run.
166 .PP
167 In replay mode, if the standard output has not been redirected,
168 \&\fBsudoreplay\fR will act on the following keys:
169 .IP "' ' (space)" 8
170 .IX Item "' ' (space)"
171 Pause output; press any key to resume.
172 .IP "'<'" 8
173 Reduce the playback speed by one half.
174 .IP "'>'" 8
175 Double the playback speed.
176 .SH "OPTIONS"
177 .IX Header "OPTIONS"
178 \&\fBsudoreplay\fR accepts the following command line options:
179 .IP "\-d \fIdirectory\fR" 12
180 .IX Item "-d directory"
181 Use \fIdirectory\fR to for the session logs instead of the default,
182 \&\fI/var/log/sudo\-io\fR.
183 .IP "\-f \fIfilter\fR" 12
184 .IX Item "-f filter"
185 By default, \fBsudoreplay\fR will play back the command's standard
186 output, standard error and tty output.  The \fI\-f\fR option can be
187 used to select which of these to output.  The \fIfilter\fR argument
188 is a comma-separated list, consisting of one or more of following:
189 \&\fIstdout\fR, \fIstderr\fR, and \fIttyout\fR.
190 .IP "\-h" 12
191 .IX Item "-h"
192 The \fB\-h\fR (\fIhelp\fR) option causes \fBsudoreplay\fR to print a short
193 help message to the standard output and exit.
194 .IP "\-l [\fIsearch expression\fR]" 12
195 .IX Item "-l [search expression]"
196 Enable \*(L"list mode\*(R".  In this mode, \fBsudoreplay\fR will list available
197 session IDs.  If a \fIsearch expression\fR is specified, it will be
198 used to restrict the IDs that are displayed.  An expression is
199 composed of the following predicates:
200 .RS 12
201 .IP "command \fIcommand pattern\fR" 8
202 .IX Item "command command pattern"
203 Evaluates to true if the command run matches \fIcommand pattern\fR.
204 On systems with \s-1POSIX\s0 regular expression support, the pattern may
205 be an extended regular expression.  On systems without \s-1POSIX\s0 regular
206 expression support, a simple substring match is performed instead.
207 .IP "cwd \fIdirectory\fR" 8
208 .IX Item "cwd directory"
209 Evaluates to true if the command was run with the specified current
210 working directory.
211 .IP "fromdate \fIdate\fR" 8
212 .IX Item "fromdate date"
213 Evaluates to true if the command was run on or after \fIdate\fR.
214 See \*(L"Date and time format\*(R" for a description of supported
215 date and time formats.
216 .IP "group \fIrunas_group\fR" 8
217 .IX Item "group runas_group"
218 Evaluates to true if the command was run with the specified
219 \&\fIrunas_group\fR.  Note that unless a \fIrunas_group\fR was explicitly
220 specified when \fBsudo\fR was run this field will be empty in the log.
221 .IP "runas \fIrunas_user\fR" 8
222 .IX Item "runas runas_user"
223 Evaluates to true if the command was run as the specified \fIrunas_user\fR.
224 Note that \fBsudo\fR runs commands as user \fIroot\fR by default.
225 .IP "todate \fIdate\fR" 8
226 .IX Item "todate date"
227 Evaluates to true if the command was run on or prior to \fIdate\fR.
228 See \*(L"Date and time format\*(R" for a description of supported
229 date and time formats.
230 .IP "tty \fItty\fR" 8
231 .IX Item "tty tty"
232 Evaluates to true if the command was run on the specified terminal
233 device.  The \fItty\fR should be specified without the \fI/dev/\fR prefix,
234 e.g.  \fItty01\fR instead of \fI/dev/tty01\fR.
235 .IP "user \fIuser name\fR" 8
236 .IX Item "user user name"
237 Evaluates to true if the \s-1ID\s0 matches a command run by \fIuser name\fR.
238 .RE
239 .RS 12
240 .Sp
241 Predicates may be abbreviated to the shortest unique string (currently
242 all predicates may be shortened to a single character).
243 .Sp
244 Predicates may be combined using \fIand\fR, \fIor\fR and \fI!\fR operators
245 as well as \f(CW\*(Aq(\*(Aq\fR and \f(CW\*(Aq)\*(Aq\fR for grouping (note that parentheses
246 must generally be escaped from the shell).  The \fIand\fR operator is
247 optional, adjacent predicates have an implied \fIand\fR unless separated
248 by an \fIor\fR.
249 .RE
250 .IP "\-m \fImax_wait\fR" 12
251 .IX Item "-m max_wait"
252 Specify an upper bound on how long to wait between key presses or
253 output data.  By default, \fBsudo_replay\fR will accurately reproduce
254 the delays between key presses or program output.  However, this
255 can be tedious when the session includes long pauses.  When the
256 \&\fI\-m\fR option is specified, \fBsudoreplay\fR will limit these pauses
257 to at most \fImax_wait\fR seconds.  The value may be specified as a
258 floating point number, .e.g. \fI2.5\fR.
259 .IP "\-s \fIspeed_factor\fR" 12
260 .IX Item "-s speed_factor"
261 This option causes \fBsudoreplay\fR to adjust the number of seconds
262 it will wait between key presses or program output.  This can be
263 used to slow down or speed up the display.  For example, a
264 \&\fIspeed_factor\fR of \fI2\fR would make the output twice as fast whereas
265 a \fIspeed_factor\fR of <.5> would make the output twice as slow.
266 .IP "\-V" 12
267 .IX Item "-V"
268 The \fB\-V\fR (version) option causes \fBsudoreplay\fR to print its version number
269 and exit.
270 .SS "Date and time format"
271 .IX Subsection "Date and time format"
272 The time and date may be specified multiple ways, common formats include:
273 .IP "\s-1HH:MM:SS\s0 am \s-1MM/DD/CCYY\s0 timezone" 8
274 .IX Item "HH:MM:SS am MM/DD/CCYY timezone"
275 24 hour time may be used in place of am/pm.
276 .IP "\s-1HH:MM:SS\s0 am Month, Day Year timezone" 8
277 .IX Item "HH:MM:SS am Month, Day Year timezone"
278 24 hour time may be used in place of am/pm, and month and day names
279 may be abbreviated.  Note that month and day of the week names must
280 be specified in English.
281 .IP "CCYY-MM-DD \s-1HH:MM:SS\s0" 8
282 .IX Item "CCYY-MM-DD HH:MM:SS"
283 \&\s-1ISO\s0 time format
284 .IP "\s-1DD\s0 Month \s-1CCYY\s0 \s-1HH:MM:SS\s0" 8
285 .IX Item "DD Month CCYY HH:MM:SS"
286 The month name may be abbreviated.
287 .PP
288 Either time or date may be omitted, the am/pm and timezone are
289 optional.  If no date is specified, the current day is assumed; if
290 no time is specified, the first second of the specified date is
291 used.  The less significant parts of both time and date may also
292 be omitted, in which case zero is assumed.  For example, the following
293 are all valid:
294 .PP
295 The following are all valid time and date specifications:
296 .IP "now" 8
297 .IX Item "now"
298 The current time and date.
299 .IP "tomorrow" 8
300 .IX Item "tomorrow"
301 Exactly one day from now.
302 .IP "yesterday" 8
303 .IX Item "yesterday"
304 24 hours ago.
305 .IP "2 hours ago" 8
306 .IX Item "2 hours ago"
307 2 hours ago.
308 .IP "next Friday" 8
309 .IX Item "next Friday"
310 The first second of the next Friday.
311 .IP "this week" 8
312 .IX Item "this week"
313 The current time but the first day of the coming week.
314 .IP "a fortnight ago" 8
315 .IX Item "a fortnight ago"
316 The current time but 14 days ago.
317 .IP "10:01 am 9/17/2009" 8
318 .IX Item "10:01 am 9/17/2009"
319 10:01 am, September 17, 2009.
320 .IP "10:01 am" 8
321 .IX Item "10:01 am"
322 10:01 am on the current day.
323 .IP "10" 8
324 .IX Item "10"
325 10:00 am on the current day.
326 .IP "9/17/2009" 8
327 .IX Item "9/17/2009"
328 00:00 am, September 17, 2009.
329 .IP "10:01 am Sep 17, 2009" 8
330 .IX Item "10:01 am Sep 17, 2009"
331 10:01 am, September 17, 2009.
332 .SH "FILES"
333 .IX Header "FILES"
334 .IP "\fI/var/log/sudo\-io\fR" 24
335 .IX Item "/var/log/sudo-io"
336 The default I/O log directory.
337 .IP "\fI/var/log/sudo\-io/00/00/01/log\fR" 24
338 .IX Item "/var/log/sudo-io/00/00/01/log"
339 Example session log info.
340 .IP "\fI/var/log/sudo\-io/00/00/01/stdin\fR" 24
341 .IX Item "/var/log/sudo-io/00/00/01/stdin"
342 Example session standard input log.
343 .IP "\fI/var/log/sudo\-io/00/00/01/stdout\fR" 24
344 .IX Item "/var/log/sudo-io/00/00/01/stdout"
345 Example session standard output log.
346 .IP "\fI/var/log/sudo\-io/00/00/01/stderr\fR" 24
347 .IX Item "/var/log/sudo-io/00/00/01/stderr"
348 Example session standard error log.
349 .IP "\fI/var/log/sudo\-io/00/00/01/ttyin\fR" 24
350 .IX Item "/var/log/sudo-io/00/00/01/ttyin"
351 Example session tty input file.
352 .IP "\fI/var/log/sudo\-io/00/00/01/ttyout\fR" 24
353 .IX Item "/var/log/sudo-io/00/00/01/ttyout"
354 Example session tty output file.
355 .IP "\fI/var/log/sudo\-io/00/00/01/timing\fR" 24
356 .IX Item "/var/log/sudo-io/00/00/01/timing"
357 Example session timing file.
358 .PP
359 Note that the \fIstdin\fR, \fIstdout\fR and \fIstderr\fR files will be empty
360 unless \fBsudo\fR was used as part of a pipeline for a particular
361 command.
362 .SH "EXAMPLES"
363 .IX Header "EXAMPLES"
364 List sessions run by user \fImillert\fR:
365 .PP
366 .Vb 1
367 \& sudoreplay \-l user millert
368 .Ve
369 .PP
370 List sessions run by user \fIbob\fR with a command containing the string vi:
371 .PP
372 .Vb 1
373 \& sudoreplay \-l user bob command vi
374 .Ve
375 .PP
376 List sessions run by user \fIjeff\fR that match a regular expression:
377 .PP
378 .Vb 1
379 \& sudoreplay \-l user jeff command \*(Aq/bin/[a\-z]*sh\*(Aq
380 .Ve
381 .PP
382 List sessions run by jeff or bob on the console:
383 .PP
384 .Vb 1
385 \& sudoreplay \-l ( user jeff or user bob ) tty console
386 .Ve
387 .SH "SEE ALSO"
388 .IX Header "SEE ALSO"
389 \&\fIsudo\fR\|(@mansectsu@), \fIscript\fR\|(1)
390 .SH "AUTHOR"
391 .IX Header "AUTHOR"
392 Todd C. Miller
393 .SH "BUGS"
394 .IX Header "BUGS"
395 If you feel you have found a bug in \fBsudoreplay\fR, please submit a bug report
396 at http://www.sudo.ws/sudo/bugs/
397 .SH "SUPPORT"
398 .IX Header "SUPPORT"
399 Limited free support is available via the sudo-users mailing list,
400 see http://www.sudo.ws/mailman/listinfo/sudo\-users to subscribe or
401 search the archives.
402 .SH "DISCLAIMER"
403 .IX Header "DISCLAIMER"
404 \&\fBsudoreplay\fR is provided ``\s-1AS\s0 \s-1IS\s0'' and any express or implied warranties,
405 including, but not limited to, the implied warranties of merchantability
406 and fitness for a particular purpose are disclaimed.  See the \s-1LICENSE\s0
407 file distributed with \fBsudo\fR or http://www.sudo.ws/sudo/license.html
408 for complete details.