Home

Awesome

ovh-ttyrec

ttyrec is a terminal (tty) recorder, it comes with ttyplay, which is a tty player.

The original ttyrec is Copyright (c) 2000 Satoru Takabayashi.

The original ttyrec is based on the script program, Copyright (c) 1980 Regents of the University of California.

ovh-ttyrec is based (and compatible with) the original ttyrec, and can be used as a drop-in replacement. It is licensed under the 3-clause BSD license (see LICENSE file).

Efforts have been made to ensure the code is portable. It is known to work under at least:

It should work under any POSIX OS that support either openpty() or the grantpt()/unlockpt() mechanisms.

features

compilation

To compile the binaries and build the man pages, just run:

    $ ./configure && make

You'll need libzstd on the build machine if you want ttyrec to be compiled with zstd support. The library will be statically linked when possible.

If you explicitly don't want libzstd, define NO_ZSTD=1 before running configure. If you want it but dynamically linked, define NO_STATIC_ZSTD=1.

Installation:

    $ make install

Note that installation is not needed to test the binaries: you can just call ./ttyrec from the build folder.

build a .deb package

If you want to build a .deb (Debian/Ubuntu) package, just run:

    $ ./configure && make deb

build a .rpm package

If you want to build a .rpm (RHEL/CentOS) package, just run:

    $ ./configure && make rpm

usage

The simplest usage is just calling the binary, it'll execute the users' shell and record the session until exit:

    $ ttyrec

To replay this session:

    $ ttyplay ./ttyrecord

Run some shell commands:

    $ ttyrec -f cmds.ttyrec -- sh -c 'for i in a b c; do echo $i; done'

Connect to a remote machine interactively, lock the session after 1 minute of inactivity, and kill it after 5 minutes of inactivity:

    $ ttyrec -t 60 -k 300 -- ssh remoteserver

Execute a local script remotely with the default remote shell:

    $ cat script.sh | ttyrec -- ssh remoteserver

Record a screen session, with on-the-fly compression:

    $ ttyrec -Z screen

Usage information:

    $ ttyrec -h

version scheme

We follow the version format A.B.C.D. The following rules apply:

When a digit is incremented, all the "lower" ones go back to zero, i.e. if we are at version 4.7.1.5, and we implement a breaking change, the version number becomes 4.8.0.0.