parallel-ssh
Asynchronous parallel SSH library
What it is and what it does
parallel-ssh is an asynchronous SSH client library that wraps native C SSH implementations (libssh2 or libssh) to execute commands across many remote hosts concurrently. It uses gevent for event-loop coordination and provides both a ParallelSSHClient for multi-host operations and a single-host SSHClient with a similar API. The library is designed to scale from dozens to hundreds of thousands of concurrent connections while keeping CPU and memory overhead on the client low.
The package supports command execution, file transfer via SFTP and SCP, and output streaming. It handles asynchronous result gathering through generators and provides a join() method to wait for all operations to complete. Exit codes and output become available after iteration or join, and the library includes built-in host logging utilities. The native C backend means it trades Python-only portability for significant performance gains over pure-Python SSH libraries.
Use it for:
- Deploy or update software across a fleet of servers by running the same command in parallel on all hosts.
- Gather system information (logs, metrics, configuration) from many machines simultaneously without blocking.
- Copy files to or from multiple remote hosts in parallel using SFTP or SCP.
- Automate infrastructure provisioning or configuration management tasks that require SSH access to many nodes.
- Monitor or troubleshoot distributed systems by executing diagnostic commands across all servers at once.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Asynchronous SSH client for running commands on hundreds or thousands of remote servers in parallel with minimal client-side overhead, using native C libraries for performance.
Yes, if you need to manage SSH operations across multiple hosts at scale. The native C backend and gevent integration make it substantially faster and lighter than pure-Python alternatives. LGPL-2.1-only licensing is permissive for internal use but requires attention if you distribute derivative code. No known vulnerabilities, active maintenance, and stable API make it production-ready for infrastructure automation and multi-host operations.
Install
parallel-ssh on PyPI
pip
pip install parallel-sshuv
uv add parallel-sshpoetry
poetry add parallel-sshInstalling parallel-ssh
Before you install
Low friction installation via wheel distribution. Actively maintained with recent commits and stable production status. Depends on gevent and native SSH libraries (ssh2-python or ssh-python), which are themselves mature C-based projects.
License in practice
Licensed under LGPL-2.1-only (copyleft). Derivative works and modifications must be released under the same license; linking in proprietary applications requires careful review of your distribution model.
Quickstart
pip install parallel-ssh
from parallel_ssh.clients import ParallelSSHClient
hosts = ['host1', 'host2']
client = ParallelSSHClient(hosts)
output = client.run_command('uname')
for host_output in output:
for line in host_output.stdout:
print(line)
Requires SSH connectivity to target hosts and compatible SSH server configuration; gevent event loop integration is implicit.
Verify before relying
- Whether ssh2-python or ssh-python is automatically selected based on environment or requires explicit configuration.
- Specific performance characteristics (throughput, latency) compared to alternatives under real-world load.
- Whether SFTP/SCP operations work with all SSH server implementations or have known compatibility gaps.
Package facts
| License | LGPL-2.1-only (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — gevent, ssh2-python, ssh-python |
| Maintenance | actively maintained — 304 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 206,020/month — #9,579 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: parallel_ssh-2.16.0.post1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
asyncsshAsyncSSH provides an asynchronous SSH client…
copyleft · top 5,000 on PyPI
ssh-pythonPython bindings to the libssh C library for SSH…
copyleft · top 15,000 on PyPI
pyinfrapyinfra executes Python code as infrastructure…
permissive · top 15,000 on PyPI
sshconfsshconf reads and modifies SSH config files…
permissive · top 15,000 on PyPI
ssh2-pythonssh2-python provides Python bindings to…
copyleft · top 15,000 on PyPI
sshfsProvides an fsspec-compatible filesystem…
permissive · top 5,000 on PyPI
rclone-pythonA Python wrapper that exposes rclone's cloud…
permissive · top 15,000 on PyPI
grequestsGRequests wraps the requests library with…
permissive · top 15,000 on PyPI
jumpsshJumpSSH runs commands on remote servers through…
permissive · top 15,000 on PyPI
paramikoParamiko is a pure-Python SSH protocol library…
copyleft · top 1,000 on PyPI