|SUDOREPLAY(8)||System Manager's Manual||SUDOREPLAY(8)|
replay sudo session logs
sudoreplayplays back or lists the output logs created by
sudo. When replaying,
sudoreplaycan play the session back in real-time, or the playback speed may be adjusted (faster or slower) based on the command line options. The ID should either be a six character sequence of digits and upper case letters, e.g.
0100A5, or a pattern matching the iolog_file option in the sudoers file. When a command is run via
sudowith log_output enabled in the sudoers file, a
TSID=IDstring is logged via syslog or to the
sudolog file. The ID may also be determined using
sudoreplay's list mode. In list mode,
sudoreplaycan be used to find the ID of a session based on a number of criteria such as the user, tty or command run. In replay mode, if the standard output has not been redirected,
sudoreplaywill act on the following keys:
\n’ or ‘
- Skip to the next replay event; useful for long pauses.
- Pause output; press any key to resume.
- Reduce the playback speed by one half.
- Double the playback speed.
- Store session logs in dir instead of the default, /var/log/sudo-io.
- Select which I/O type(s) to display. By default,
sudoreplaywill display the command's standard output, standard error and tty output. The filter argument is a comma-separated list, consisting of one or more of following: stdin, stdout, stderr, ttyin, and ttyout.
- Display a short help message to the standard output and exit.
- Enable “list mode”. In this mode,
sudoreplaywill list available sessions in a format similar to the
sudolog file format, sorted by file name (or sequence number). If a search expression is specified, it will be used to restrict the IDs that are displayed. An expression is composed of the following predicates:
- command pattern
- Evaluates to true if the command run matches the POSIX extended regular expression pattern.
- cwd directory
- Evaluates to true if the command was run with the specified current working directory.
- fromdate date
- Evaluates to true if the command was run on or after date. See Date and time format for a description of supported date and time formats.
- group runas_group
- Evaluates to true if the command was run with the specified
runas_group. Note that unless a
runas_group was explicitly specified
sudowas run this field will be empty in the log.
- runas runas_user
- Evaluates to true if the command was run as the specified
runas_user. Note that
sudoruns commands as user root by default.
- todate date
- Evaluates to true if the command was run on or prior to date. See Date and time format for a description of supported date and time formats.
- tty tty name
- Evaluates to true if the command was run on the specified terminal device. The tty name should be specified without the /dev/ prefix, e.g. tty01 instead of /dev/tty01.
- user user name
- Evaluates to true if the ID matches a command run by user name.
(’ and ‘
)’ grouping (note that parentheses must generally be escaped from the shell). The and operator is optional, adjacent predicates have an implied and unless separated by an or.
- Specify an upper bound on how long to wait between key presses or output
data. By default,
sudoreplaywill accurately reproduce the delays between key presses or program output. However, this can be tedious when the session includes long pauses. When the
-moption is specified,
sudoreplaywill limit these pauses to at most max_wait seconds. The value may be specified as a floating point number, e.g. 2.5.
- This option causes
sudoreplayto adjust the number of seconds it will wait between key presses or program output. This can be used to slow down or speed up the display. For example, a speed_factor of 2 would make the output twice as fast whereas a speed_factor of .5 would make the output twice as slow.
- Print the
sudoreplayversions version number and exit.
Date and time format¶The time and date may be specified multiple ways, common formats include:
- HH:MM:SS am MM/DD/CCYY timezone
- 24 hour time may be used in place of am/pm.
- HH:MM:SS am Month, Day Year timezone
- 24 hour time may be used in place of am/pm, and month and day names may be abbreviated. Note that month and day of the week names must be specified in English.
- CCYY-MM-DD HH:MM:SS
- ISO time format
- DD Month CCYY HH:MM:SS
- The month name may be abbreviated.
- The current time and date.
- Exactly one day from now.
- 24 hours ago.
- 2 hours ago
- 2 hours ago.
- next Friday
- The first second of the Friday in the next (upcoming) week. Not to be confused with “this friday” which would match the friday of the current week.
- last week
- The current time but 7 days ago. This is equivalent to “a week ago”.
- a fortnight ago
- The current time but 14 days ago.
- 10:01 am 9/17/2009
- 10:01 am, September 17, 2009.
- 10:01 am
- 10:01 am on the current day.
- 10:00 am on the current day.
- 00:00 am, September 17, 2009.
- 10:01 am Sep 17, 2009
- 10:01 am, September 17, 2009.
sudoreplayversions 1.8.4 and higher support a flexible debugging framework that is configured via
Debuglines in the sudo.conf(5) file. For more information on configuring sudo.conf(5), please refer to its manual.
- Debugging framework configuration
- The default I/O log directory.
- Example session log info.
- Example session standard input log.
- Example session standard output log.
- Example session standard error log.
- Example session tty input file.
- Example session tty output file.
- Example session timing file.
sudowas used as part of a pipeline for a particular command.
EXAMPLES¶List sessions run by user millert:
# sudoreplay -l user millert
# sudoreplay -l user bob command vi
# sudoreplay -l user jeff command '/bin/[a-z]*sh'
# sudoreplay -l ( user jeff or user bob ) tty console
SEE ALSO¶script(1), sudo.conf(5), sudo(8)
AUTHORS¶Many people have worked on
sudoover the years; this version consists of code written primarily by:
Todd C. MillerSee the CONTRIBUTORS file in the
sudodistribution (https://www.sudo.ws/contributors.html) for an exhaustive list of people who have contributed to
BUGS¶If you feel you have found a bug in
sudoreplay, please submit a bug report at https://bugzilla.sudo.ws/
SUPPORT¶Limited free support is available via the sudo-users mailing list, see https://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search the archives.
sudoreplayis provided “AS IS” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. See the LICENSE file distributed with
sudoor https://www.sudo.ws/license.html for complete details.
|November 30, 2016||Sudo 1.8.19p1|