sshp4ru is a high-performance, parallel SSH executor, rewritten in Rust, based on the C-based sshp
project by Dave Eddy and Rany. This tool is designed to execute SSH commands concurrently across multiple hosts, managing the associated SSH connections efficiently and coalescing the output in a systematic manner.
The original node-sshp
was developed in Node.js and was later rereleased in C. This adaptation was based off the C version, which offered a straightforward solution for managing multiple SSH processes in parallel. The project was well-regarded for its ability to handle a large number of concurrent SSH connections while efficiently managing their output. The sshp4ru project re-implements this functionality in Rust, a systems programming language known for its memory safety, concurrency and performance guarantees. This rewrite ensures that the tool remains robust and resilient to memory-related issues.
Before using sshp4ru
, make sure you have Rust >= 2021 installed on your system.
-
Clone the repository and navigate to the project's directory:
git clone https://github.com/Sofosss/sshp4ru.git cd sshp4ru
-
Install the CLI binary:
cargo install --path . --release
Note
The compiled binary will be located in the ~/.cargo/bin directory (which should be in PATH).
-
Alternatively, compile the CLI binary and copy it manually:
cargo build --release cp ./target/release/sshp4ru /usr/local/bin
-
Verify the installation by checking the version:
sshp4ru --version
-
The functionality of
sshp4ru
is identical to the C-based implementation ofsshp
. The core features and behavior have been preserved. -
The command-line interface (CLI) remains unchanged, meaning you can use
sshp4ru
in the same way you would usesshp
. The only difference is the name of the executable (sshp4ru
) when running commands. -
The handling of exit codes follows the same conventions as the
sshp
implementation, ensuring compatibility. For detailed information on how exit codes are used, you can refer to the documentation ofsshp
. -
To check the functionality of
sshp4ru
, you can refer to the examples from the C-based version. The interface, arguments and expected results will be the same.
If the C-based implementation command was:
sshp -f hosts.txt -m 3 uname -v
The equivalent command with sshp4ru would be:
sshp4ru -f hosts.txt -m 3 uname -v
The test suite included in this version of the project was originally part of the C-based implementation and has since been adapted to the Rust version.
Note
In order to run the tests, you should use cargo build instead of cargo build --release. The compiled binary will be located in the ./target/debug/ directory when using the standard build configuration.
The style requirements are minimal and are incorporated via the cargo fmt
command based on rustfmt.toml
file. They ensure:
- Each line has maximum width of 100 columns.
- Each tab equals 4 spaces.
- We use spaces both for identation and for alignment.
- We use a compressed layout of function parameters.
In the pursuit of self-improvement, any new suggestions, solutions and potential bug fixes are welcome. Just open an issue or submit a pull request.
The following features and enhancements are potential candidates for future development:
- Implementing
kqueue
for event monitoring to enhance event handling on systems that support kqueue. - Publish the project on crates.io.
- Adding a password login timer to enforce a time limit for password-based logins.
- Sofotasios Argiris | [email protected]
- Metaxakis Dimitris | [email protected]
Distributed under the MIT License. See LICENSE.md
for more details.