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