Skip to main content

parallel-ssh

Small wrapper library over paramiko that allows for parallel execution of SSH commands on remote hosts and executing simple single host commands over SSH.

parallel-ssh uses asychronous network requests, there is no multi-threading or multi-processing used. This is a requirement for commands on many (hundreds) of hosts which would grind a system to a halt simply by having so many processes/threads all wanting to execute if done with multi-threading/processing.

https://api.travis-ci.org/pkittenis/parallel-ssh.png?branch=master

Module documentation can be found at the repository’s github pages.

Installation

$ pip install parallel-ssh

Usage Examples

See documentation on github pages for more complete examples

Run ls on two remote hosts in parallel.

>>> from pssh import ParallelSSHClient
>>> hosts = ['myhost1', 'myhost2']
>>> client = ParallelSSHClient(hosts)
>>> cmds = client.exec_command('ls -ltrh /tmp/aasdfasdf', sudo = True)
>>> print [client.get_stdout(cmd) for cmd in cmds]
[localhost]     drwxr-xr-x  6 xxx xxx 4.0K Jan  1 00:00 xxx
[{'localhost': {'exit_code': 0}}]

SFTP support

SFTP is supported (scp version 2 protocol) natively, no scp command used.

For example to copy a local file to remote hosts in parallel

>>> from pssh import ParallelSSHClient
>>> hosts = ['myhost1', 'myhost2']
>>> client = ParallelSSHClient(hosts)
>>> client.copy_file('../test', 'test_dir/test')
>>> client.pool.join()
Copied local file ../test to remote destination myhost1:test_dir/test
Copied local file ../test to remote destination myhost2:test_dir/test

Metadata

Release files for parallel-ssh 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parallel-ssh 0.4
File Size Uploaded Provenance Actions
parallel-ssh-0.4.tar.gz 6.2 kB Without provenance Details for parallel-ssh-0.4.tar.gz

Release files / parallel-ssh-0.4.tar.gz

Download URL parallel-ssh-0.4.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6560e27d5fb577764e3b5988753afcebfdbb9f7b756ee3c1dcb9a1e8baf298bc
BLAKE2b-256 checksum
How to use checksums
183035be1a93b387e0ee42ecb9c8cf6536b2ee8cd6db1813c2833d5b07c18f34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for parallel-ssh 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file No provenance

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