skillfed

parallel-ssh

Asynchronous parallel SSH library

parallel-ssh v2.16.0.post1 206.0K downloads/30d#9,579 on PyPI1,281
Copyleft license LGPL-2.1-only Active released

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-ssh

uv

uv add parallel-ssh

poetry

poetry add parallel-ssh

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: BSDOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: NetworkingTopic :: System :: Shells

Tags

parallel ssh executionasync remote command runnerbulk ssh operationsmulti-host ssh clienthigh-performance ssh librarygevent ssh automationlibssh2 python wrapper
infrastructure-automationasync-iomulti-host-operations

More Libraries packages