Skip to main content

SSH Wrapper

ssh-wrapper owns one native OpenSSH ControlMaster and exposes only no-fallback mux channels. It can also supervise one remote process group with a bounded heartbeat lease, so owner loss cleans up only that group.

The runtime is fully typed and uses only the Python standard library. It does not choose hosts, store credentials, reconnect a lost master, or define a consumer protocol.

Requirements

  • CPython 3.13 or 3.14
  • Linux
  • an OpenSSH client
  • python3 on the remote host only when using OwnedRemoteProcess

Installation

Install an exact reviewed version with pip:

python3.13 -m pip install "ssh-wrapper==0.1.0"

Use python3.14 in the same command when that is the selected supported interpreter.

This is a library and does not install a command-line entry point, so pipx is not an appropriate installation method.

Basic use

import asyncio
from pathlib import Path

from ssh_wrapper import ConnectionSpec, OpenSSHMaster, SSHMasterSettings


async def run() -> bytes:
    master = OpenSSHMaster(
        SSHMasterSettings(
            ssh_path=Path("/usr/bin/ssh"),
            false_path=Path("/usr/bin/false"),
            connect_timeout=30,
        ),
        ConnectionSpec.from_alias("workstation"),
    )
    await master.start()
    try:
        process = await asyncio.create_subprocess_exec(
            *master.command_argv("uname -a"),
            stdout=asyncio.subprocess.PIPE,
        )
        stdout, _stderr = await process.communicate()
        if process.returncode:
            raise RuntimeError(f"remote command exited {process.returncode}")
        return stdout
    finally:
        await master.close()

The caller owns each ordinary secondary process and its output. Use OwnedRemoteProcess for a long-lived child that must remain tied to an owner lease.

Project links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssh_wrapper-0.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssh_wrapper-0.1.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file ssh_wrapper-0.1.0.tar.gz.

File metadata

  • Download URL: ssh_wrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ssh_wrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0596fce059676285aef609aadebe999d272d4e5140bf469fddedc965df4968f2
MD5 b76db60594d3802aa21ab5790ed2eac7
BLAKE2b-256 f0429e7f85c1b94187558fff0ec2cafbd5e81f8f6df099f1796224667965b959

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssh_wrapper-0.1.0.tar.gz:

Publisher: release.yml on kogeler/ssh-wrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssh_wrapper-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ssh_wrapper-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ssh_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 520d9bee8b547428c1fae29e7456d5e4f70329357c6f470e71afef500cd3990a
MD5 209f54e324ef319a2d597bc6ee6a3b69
BLAKE2b-256 af6de5999895fac8d2f1fc00172cbf32672c5ec675b4fb55c47d1a4f67654c8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssh_wrapper-0.1.0-py3-none-any.whl:

Publisher: release.yml on kogeler/ssh-wrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page