2 .\" SPDX-License-Identifier: ISC
4 .\" Copyright (c) 2009-2019 Todd C. Miller <Todd.Miller@sudo.ws>
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 .Dt SUDOREPLAY @mansectsu@
20 .Os Sudo @PACKAGE_VERSION@
23 .Nd replay sudo session logs
40 plays back or lists the output logs created by
44 can play the session back in real-time, or the playback speed may be
45 adjusted (faster or slower) based on the command line options.
49 should either be a six character sequence of digits and
50 upper case letters, e.g.,
52 a pattern matching the
57 Path names may be relative to the
61 file (unless overridden by the
63 option) or fully qualified, beginning with a
66 When a command is run via
74 string is logged via syslog or to the
79 may also be determined using
85 can be used to find the ID of a session based on a number of criteria
86 such as the user, tty or command run.
88 In replay mode, if the standard input and output are connected to a terminal
91 option is not specified,
93 will operate interactively.
96 will attempt to adjust the terminal size to match that of the session and
97 write directly to the terminal (not all terminals support this).
98 Additionally, it will poll the keyboard and act on the following keys:
100 .It So Li \en Sc No or So Li \er Sc
101 Skip to the next replay event; useful for long pauses.
102 .It So Li \ Sc Pq space
103 Pause output; press any key to resume.
105 Reduce the playback speed by one half.
107 Double the playback speed.
110 The session can be interrupted via control-C.
111 When the session has finished, the terminal is restored to its
112 original size if it was changed during playback.
114 The options are as follows:
116 .It Fl d Ar dir , Fl -directory Ns = Ns Ar dir
117 Store session logs in
119 instead of the default,
121 .It Fl f Ar filter , Fl -filter Ns = Ns Ar filter
122 Select which I/O type(s) to display.
125 will display the command's standard output, standard error and tty output.
128 argument is a comma-separated list, consisting of one or more of following:
136 Display a short help message to the standard output and exit.
137 .It Fl l , -list Op Ar search expression
142 will list available sessions in a format similar to the
144 log file format, sorted by file name (or sequence number).
146 .Ar search expression
147 is specified, it will be used to restrict the IDs that are displayed.
148 An expression is composed of the following predicates:
150 .It command Ar pattern
151 Evaluates to true if the command run matches the POSIX extended
155 Evaluates to true if the command was run with the specified current
158 Evaluates to true if the command was run on or after
161 .Sx Date and time format
162 for a description of supported date and time formats.
163 .It group Ar runas_group
164 Evaluates to true if the command was run with the specified
168 was explicitly specified when
170 was run this field will be empty in the log.
171 .It runas Ar runas_user
172 Evaluates to true if the command was run as the specified
176 runs commands as user
180 Evaluates to true if the command was run on or prior to
183 .Sx Date and time format
184 for a description of supported date and time formats.
186 Evaluates to true if the command was run on the specified terminal device.
189 should be specified without the
195 .It user Ar user name
196 Evaluates to true if the ID matches a command run by
200 Predicates may be abbreviated to the shortest unique string.
202 Predicates may be combined using
211 grouping (note that parentheses must generally be escaped from the shell).
214 operator is optional, adjacent predicates have an implied
216 unless separated by an
218 .It Fl m , -max-wait Ar max_wait
219 Specify an upper bound on how long to wait between key presses or output data.
222 will accurately reproduce the delays between key presses or program output.
223 However, this can be tedious when the session includes long pauses.
228 will limit these pauses to at most
231 The value may be specified as a floating point number, e.g.,
235 of zero or less will eliminate the pauses entirely.
236 .It Fl n , -non-interactive
237 Do not prompt for user input or attempt to re-size the terminal.
238 The session is written to the standard output, not directly to
240 .It Fl R , -no-resize
241 Do not attempt to re-size the terminal to match the terminal size
243 .It Fl S , -suspend-wait
244 Wait while the command was suspended.
247 will ignore the time interval between when the command was suspended
248 and when it was resumed.
254 .It Fl s , -speed Ar speed_factor
257 to adjust the number of seconds it will wait between key presses or
259 This can be used to slow down or speed up the display.
264 would make the output twice as fast whereas a
268 would make the output twice as slow.
272 versions version number and exit.
274 .Ss Date and time format
275 The time and date may be specified multiple ways, common formats include:
277 .It HH:MM:SS am MM/DD/CCYY timezone
278 24 hour time may be used in place of am/pm.
279 .It HH:MM:SS am Month, Day Year timezone
280 24 hour time may be used in place of am/pm, and month and day names
282 Note that month and day of the week names must be specified in English.
283 .It CCYY-MM-DD HH:MM:SS
285 .It DD Month CCYY HH:MM:SS
286 The month name may be abbreviated.
289 Either time or date may be omitted, the am/pm and timezone are optional.
290 If no date is specified, the current day is assumed; if no time is
291 specified, the first second of the specified date is used.
292 The less significant parts of both time and date may also be omitted,
293 in which case zero is assumed.
295 The following are all valid time and date specifications:
298 The current time and date.
300 Exactly one day from now.
306 The first second of the Friday in the next (upcoming) week.
307 Not to be confused with
309 which would match the Friday of the current week.
311 The current time but 7 days ago.
312 This is equivalent to
315 The current time but 14 days ago.
316 .It 10:01 am 9/17/2009
317 10:01 am, September 17, 2009.
319 10:01 am on the current day.
321 10:00 am on the current day.
323 00:00 am, September 17, 2009.
324 .It 10:01 am Sep 17, 2009
325 10:01 am, September 17, 2009.
328 Note that relative time specifications do not always work as expected.
331 qualifier is intended to be used in conjunction with a day such as
333 When used with units of weeks, months, years, etc
334 the result will be one more than expected.
337 will result in a time exactly two weeks from now, which is probably
338 not what was intended.
339 This will be addressed in a future version of
341 .Ss Debugging sudoreplay
343 versions 1.8.4 and higher support a flexible debugging framework
344 that is configured via
347 .Xr sudo.conf @mansectform@
350 For more information on configuring
351 .Xr sudo.conf @mansectform@ ,
352 please refer to its manual.
355 .It Pa @sysconfdir@/sudo.conf
356 Debugging framework configuration
358 The default I/O log directory.
359 .It Pa @iolog_dir@/00/00/01/log
360 Example session log info.
361 .It Pa @iolog_dir@/00/00/01/stdin
362 Example session standard input log.
363 .It Pa @iolog_dir@/00/00/01/stdout
364 Example session standard output log.
365 .It Pa @iolog_dir@/00/00/01/stderr
366 Example session standard error log.
367 .It Pa @iolog_dir@/00/00/01/ttyin
368 Example session tty input file.
369 .It Pa @iolog_dir@/00/00/01/ttyout
370 Example session tty output file.
371 .It Pa @iolog_dir@/00/00/01/timing
372 Example session timing file.
380 files will be empty unless
382 was used as part of a pipeline for a particular command.
384 List sessions run by user
386 .Bd -literal -offset indent
387 # sudoreplay -l user millert
390 List sessions run by user
392 with a command containing the string vi:
393 .Bd -literal -offset indent
394 # sudoreplay -l user bob command vi
397 List sessions run by user
399 that match a regular expression:
400 .Bd -literal -offset indent
401 # sudoreplay -l user jeff command '/bin/[a-z]*sh'
404 List sessions run by jeff or bob on the console:
405 .Bd -literal -offset indent
406 # sudoreplay -l ( user jeff or user bob ) tty console
410 .Xr sudo.conf @mansectform@ ,
413 Many people have worked on
415 over the years; this version consists of code written primarily by:
416 .Bd -ragged -offset indent
420 See the CONTRIBUTORS file in the
422 distribution (https://www.sudo.ws/contributors.html) for an
423 exhaustive list of people who have contributed to
426 If you feel you have found a bug in
428 please submit a bug report at https://bugzilla.sudo.ws/
430 Limited free support is available via the sudo-users mailing list,
431 see https://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or
437 and any express or implied warranties, including, but not limited
438 to, the implied warranties of merchantability and fitness for a
439 particular purpose are disclaimed.
440 See the LICENSE file distributed with
442 or https://www.sudo.ws/license.html for complete details.