CONSPY(1)

NAME
conspy - virtual console spy tool

SYNOPSIS
conspy [ options ] [ console ]

DESCRIPTION
Conspy allows the user to take control of a Linux virtual console. The user can see what is displayed on the console and their keystrokes are sent to it.

To exit from conspy press the escape key three times in quick succession.

COMMAND LINE

-g COLSxROWS, --geometry COLSxROWS
    Specify the console size. Conspy can almost always correctly guess the size so this is only useful when it complains it can't.

-V, --version
    Print the program's version and exit.

-v, --viewonly
    Don't send keystrokes to the virtual console.

console
    If supplied, console must be a number in the range 1 .. 63, corresponding to the virtual console device /dev/tty1 .. /dev/tty63. If not supplied the currently active virtual console is opened and tracked.

LIMITATIONS
Conspy will not pass keystrokes to a virtual console whose keyboard is configured to send scan codes. X configures its keyboard like this. If the terminal does not have at least 64 colours no colour will be displayed. Conspy ignores the mouse. Conspy may display some non-ASCII characters incorrectly.

The kernel reports the console geometry and cursor position using bytes which limits both to 255 maximum. Conspy reconstructs the true display size from the truncated header by factoring the buffer length, but if that is ambiguous you must supply --geometry. The cursor position will still be placed incorrectly if it is beyond line 255 or column 255.

Conspy depends on terminfo and curses working correctly for your terminal, and sometimes they don't. Konsole is/was one example of where they don't. Typing control-L will redraw the screen, which usually fixes the mess created. It also sends a control-L to the virtual console, of course.

PERMISSIONS
Reading a virtual console requires read access to the corresponding /dev/vcsaX device, which on most distributions is granted via the tty group.

Injecting keystrokes uses the TIOCSTI ioctl, which since Linux 6.2 requires the CAP_SYS_ADMIN capability (controlled by the dev.tty.legacy_tiocsti sysctl, off by default). In practice this means conspy must be run as root, or be granted the capability with e.g. setcap cap_sys_admin+ep /usr/bin/conspy . Use --viewonly to spy on a console without needing this privilege.

FILES

/dev/ttyX, /dev/vc/X
    The characters typed are sent to this device. The latter is for devfs. It is only used if the former does not exist.

/dev/vcsaX, /dev/vcc/aX
    The display of the virtual console is read from here. The latter is for devfs. It is only used if the former does not exist.

AUTHOR
Russell Stuart, <russell-conspy@stuart.id.au>.