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/thousands/hundreds of thousands) 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 https://coveralls.io/repos/pkittenis/parallel-ssh/badge.png?branch=master version downloads Latest documentation

Module documentation can be found at read the docs.

Installation

$ pip install parallel-ssh

Usage Examples

See documentation on read the docs 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.61

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.61
File Size Uploaded Provenance Actions
parallel-ssh-0.61.tar.gz 7.6 kB Without provenance Details for parallel-ssh-0.61.tar.gz

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

Download URL parallel-ssh-0.61.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5d856f3ffe6e5b99cdb84011393341b770812a4e8edcd780c6c33899f5a65468
BLAKE2b-256 checksum
How to use checksums
5ee944ee25a454a1faed92537ff579055030fc82a5ddc786c04231aee2f5453f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for parallel-ssh 0.61

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.61 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