Skip to main content

Parallel SSH with Regex

To execute a command on a group of hosts matching a given regular expression:

pypsh cmd <hostregex> <cmd-to-execute>

E.g.:

pypsh cmd "role\d+\.customer\.your\.domain" "uptime"

Or to copy a given file to a group of hosts:

pypsh copy /tmp/here/myfile.txt "my\.domains\d+\.com" /tmp/remote/file.txt

To list the hosts that would match use the following command:

pypsh show <hostregex>

The command or file copy operation will be executed on any host that is in the known_hosts file and matches the given regular expression.

Installation

Pypsh can be installed using pip:

pip install pypsh

Development

To work on pypsh checkout the git repository, create a virtual environment and install the dependencies:

git clone https://github.com/mfussenegger/pypsh.git
cd pypsh
mkvirtualenv pypsh
pip install -r requirements.txt

Sometimes it is useful to point the pypsh command to the local development branch:

pip install --upgrade --force-reinstall --editable .

But usually it is sufficient to invoke it like this:

python pypsh/main.py {cmd,copy} ...

Metadata

Release files for pypsh 0.5.0

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

Source distribution (sdist)

Source distribution for pypsh 0.5.0
File Size Uploaded Provenance Actions
pypsh-0.5.0.tar.gz 3.3 kB Without provenance Details for pypsh-0.5.0.tar.gz

Release files / pypsh-0.5.0.tar.gz

Download URL pypsh-0.5.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0bba4a4809280c62d94e61f5ea1e70165ff374525311bad79daf1b5f1d899ab9
BLAKE2b-256 checksum
How to use checksums
62b48b5061536080aca6dad3db8ef90678e912633b69940db5f278a85325802d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pypsh 0.5.0

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.

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