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
python3on the remote host only when usingOwnedRemoteProcess
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0596fce059676285aef609aadebe999d272d4e5140bf469fddedc965df4968f2
|
|
| MD5 |
b76db60594d3802aa21ab5790ed2eac7
|
|
| BLAKE2b-256 |
f0429e7f85c1b94187558fff0ec2cafbd5e81f8f6df099f1796224667965b959
|
Provenance
The following attestation bundles were made for ssh_wrapper-0.1.0.tar.gz:
Publisher:
release.yml on kogeler/ssh-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ssh_wrapper-0.1.0.tar.gz -
Subject digest:
0596fce059676285aef609aadebe999d272d4e5140bf469fddedc965df4968f2 - Sigstore transparency entry: 2655086063
- Sigstore integration time:
-
Permalink:
kogeler/ssh-wrapper@4cf18ed371397baccd492d641cc28288d4998cb6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kogeler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4cf18ed371397baccd492d641cc28288d4998cb6 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
520d9bee8b547428c1fae29e7456d5e4f70329357c6f470e71afef500cd3990a
|
|
| MD5 |
209f54e324ef319a2d597bc6ee6a3b69
|
|
| BLAKE2b-256 |
af6de5999895fac8d2f1fc00172cbf32672c5ec675b4fb55c47d1a4f67654c8c
|
Provenance
The following attestation bundles were made for ssh_wrapper-0.1.0-py3-none-any.whl:
Publisher:
release.yml on kogeler/ssh-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ssh_wrapper-0.1.0-py3-none-any.whl -
Subject digest:
520d9bee8b547428c1fae29e7456d5e4f70329357c6f470e71afef500cd3990a - Sigstore transparency entry: 2655086074
- Sigstore integration time:
-
Permalink:
kogeler/ssh-wrapper@4cf18ed371397baccd492d641cc28288d4998cb6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kogeler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4cf18ed371397baccd492d641cc28288d4998cb6 -
Trigger Event:
push
-
Statement type: