Net::OpenSSH::OSTracer(3pm)

Net::OpenSSH::OSTracer3pm

Trace ssh master process at the os level

Usage

    use Net::OpenSSH;
    $Net::OpenSSH::debug |= 512;
    Net::OpenSSH->new($host)->system("echo hello world");
    system "less /tmp/net_openssh_master.*.strace";

Overview

This is a Net::OpenSSH helper module that allows you to trace the master "ssh" process at the operating system level using the proper utility available in your system (e.g., "strace", "truss", "ktruss", "tusc", etc.).

This feature can be used when debugging your programs or to report bugs on the module.

It is enabled setting the flag 512 on the $Net::OpenSSH::debug variable:

  $Net::OpenSSH::debug |= 512;

By default the output files of the tracer are saved as "/tmp/net_openssh_master.$pid.$tracer_type".

Also, the output send by the tracer to stdout/stderr is saved as "/tmp/net_openssh_master.$pid.txt".

The module can be configured through the following global variables:

$Net::OpenSSH::OSTracer::type

By default, the module decides which tracer to use in base to the operating system name. This variable allows one to select a different tracer.

Currently accepted types are: "strace" (Linux), "ktrace" (*BSD), "tusc" (HP-UX) and "truss" (Solaris and AIX).

$Net::OpenSSH::OSTracer::cmd

Command to execute for tracing the "ssh" process.

By default, it infers it from the tracer type selected.

$Net::OpenSSH::OSTracer::output

Basename for the destination file. The PID of the "ssh" process and the tracer type will be appended.

$Net::OpenSSH::OSTracer::sudo

This variable can be used to request the tracer to be run with "sudo" (some operating systems as for example Ubuntu, do not allow one to attach tracers, even to your own processes, unless you do it as root).

The variable has to be set with the path of the "sudo" binary. For instance:

  $Net::OpenSSH::OSTracer::sudo = '/usr/bin/sudo';

If you need to pass a password to "sudo", set the environment variable "SUDO_ASKPASS". For instance:

  SUDO_ASKPASS=/usr/bin/ssh-askpass
$Net::OpenSSH::OSTracer::delay

This variable can be used to delay the "ssh" execution so that the tracer can attach the process first. This is specially handy when using "sudo" with a password.

Releases

7 releases since Debian 8 (Jessie); the text changed 6 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13
  7. Arch

Bugs

This module has not been tested under all the operating systems is says to support.

If you find any problem, just report it, please!

From perl-net-openssh 0.84-5 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.