rsh
scripts for auto login and parallel/successively execute command on linux servers
description
- sr - server root login over ssh and escalate privileges
- sExec - successively execute command on servers list or group
- pExec - parallel execute command on servers list or group
install
pip install rsh-tools
installs the commands sr, sExec, pExec, rshInventory and rshCompgen.
with the OVH inventory plugin: pip install 'rsh-tools[ovh]'
bash completion for hosts and groups — add to ~/.bashrc:
eval "$(rshCompgen completion)"
development
git clone https://github.com/fb929/rsh && cd rsh
make dev # pip install --editable '.[dev,ovh]'
make test # pytest
the editable install puts the real commands on PATH, so the checkout is what runs.
release
bump __version__ in rsh/__init__.py (semver), then tag and push:
git tag v3.0.0 && git push origin v3.0.0
the release workflow checks that the tag matches __version__, builds sdist + wheel,
uploads them to PyPI (secret PYPI_API_TOKEN) and attaches them to the GitHub release.
configure
(optional) passwords file for "su" mode
-
create encrypt file .pass.gpg
-
add passwords in format:
<hostname regex>\t<root password>example
.* myRootPasswd -
configure ~/.rsh.yaml
sr: escalatePrivilegesCommands: - 'su -m' - 'sudo -s -E'commands are tried on the host in the listed order; the first one that gives a root shell wins, if none of them succeeds
srexits with an error. the old single-value optionescalatePrivilegesCommandstill works, but is used only whenescalatePrivilegesCommandsis empty
aws inventory plugin
- install package aws-cli
- configure ~/.aws/credentials
ovh inventory plugin
pip install 'rsh-tools[ovh]'- configure ~/.rsh.yaml
create api tokensovhInventory: api: endpoint: ovh-ca application_key: xxx application_secret: yyy consumer_key: xxx
gce inventory plugin
- install add setup gcloud cli
all configuration options
see the defaults in rsh/config.py; ~/.rsh.yaml (and /etc/rsh/config.yaml, ./.config.yaml) are deep-merged over them
Metadata
Release files for rsh-tools 3.0.1
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 |
|---|---|---|---|---|
| rsh_tools-3.0.1.tar.gz | 20.8 kB | Without provenance | Details for rsh_tools-3.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rsh_tools-3.0.1-py3-none-any.whl | Python 3 | none | any | Details for rsh_tools-3.0.1-py3-none-any.whl |
Total release size: 42.2 kB
Release files / rsh_tools-3.0.1.tar.gz
| Download URL | rsh_tools-3.0.1.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a36cbd33b9214589403b013907c07863e461dc78e1104eabf1cd930ecb20144
|
|
BLAKE2b-256 checksum How to use checksums |
054769db7505027c15ae21d3579a51a47ab58c6d952437d0a790b66b502c78ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / rsh_tools-3.0.1-py3-none-any.whl
| Download URL | rsh_tools-3.0.1-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28a93a5aa5c7603b16388d644b8ea01e507eaef47c8b11ee9099080204586c1f
|
|
BLAKE2b-256 checksum How to use checksums |
3c762a17fa99aacd8ecdbd827f67212ae84969edd8db53467d22c37cd38384e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for rsh-tools 3.0.1
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.