Introduction
Managing remote servers efficiently is crucial for system administrators and DevOps teams. rconf is a powerful command-line tool that simplifies running local shell scripts across multiple remote hosts via SSH. It eliminates the need for complex configurations, providing a lightweight and efficient way to execute scripts remotely with just a single binary.
🚀 Key Features
- Concurrent Execution: Execute scripts on multiple hosts simultaneously with configurable concurrency levels.
- Structured Logging: Provides detailed logs to aid in monitoring and troubleshooting.
- Secure Authentication: Uses SSH private keys for secure connections, supporting password-protected keys.
- Automatic Script Management: Uploads and executes scripts on remote hosts seamlessly.
- Execution Summary: Displays a summary table of execution results.
📥 Installation
1️⃣ Manual Installation
- Download the latest binary from the Releases page.
- Place the binary in your system’s
PATH
(e.g.,/usr/local/bin
). - Ensure it has executable permissions:
chmod +x /usr/local/bin/rconf
2️⃣ Homebrew Installation (macOS)
brew tap hashmap-kz/rconf
brew install rconf
🛠 Usage Example
rconf \
--pkey /path/to/private_key \
--filename /path/to/script1.sh,/path/to/script-dir/ \
--filename https://shared.company.com/path/to/script.sh \
--conn backup@10.40.240.193 \
--conn myuser@10.40.240.189:2222 \
--workers 5 \
--log execution.log
🔍 CLI Flags Overview
Flag | Short | Description |
---|---|---|
--pkey |
-i |
Path to SSH private key (required). |
--pkey-pass |
Passphrase for SSH private key (if password-protected). | |
--filename |
-f |
Comma-separated list of scripts, directories, or URLs. |
--conn |
-H |
List of remote hosts (username:password@host:port ). |
--recursive |
-R |
Process directories recursively (default: true). |
--workers |
-w |
Maximum concurrent SSH connections (default: 2). |
--log |
-l |
Log file path (default: ssh_execution.log ). |
🔧 How It Works
- Reads the specified scripts into memory.
- Establishes SSH and SFTP connections to remote hosts.
- Uploads scripts to the remote
/tmp/
directory. - Executes scripts remotely using
sudo
. - Stores and displays execution results in a structured summary.
📊 Example Output
🚀 Starting script execution...
[HOST: 10.40.240.189] 🔄 Connecting...
[HOST: 10.40.240.193] 🔄 Connecting...
[HOST: 10.40.240.193] ⏳ Uploading scripts\00-packages.sh...
[HOST: 10.40.240.193] 🚀 Executing scripts\00-packages.sh...
[HOST: 10.40.240.189] ⏳ Uploading scripts\00-packages.sh...
[HOST: 10.40.240.189] 🚀 Executing scripts\00-packages.sh...
[HOST: 10.40.240.193] ✅ Successfully executed scripts\00-packages.sh
[HOST: 10.40.240.193] ⏳ Uploading scripts\01-timezone.sh...
[HOST: 10.40.240.193] 🚀 Executing scripts\01-timezone.sh...
[HOST: 10.40.240.189] ✅ Successfully executed scripts\00-packages.sh
[HOST: 10.40.240.189] ⏳ Uploading scripts\01-timezone.sh...
[HOST: 10.40.240.189] 🚀 Executing scripts\01-timezone.sh...
[HOST: 10.40.240.193] ✅ Successfully executed scripts\01-timezone.sh
[HOST: 10.40.240.193] ⏳ Uploading scripts\02-locale.sh...
[HOST: 10.40.240.193] 🚀 Executing scripts\02-locale.sh...
[HOST: 10.40.240.189] ✅ Successfully executed scripts\01-timezone.sh
[HOST: 10.40.240.189] ⏳ Uploading scripts\02-locale.sh...
[HOST: 10.40.240.189] 🚀 Executing scripts\02-locale.sh...
[HOST: 10.40.240.189] ✅ Successfully executed scripts\02-locale.sh
[HOST: 10.40.240.189] 🔄 Disconnecting...
[HOST: 10.40.240.193] ✅ Successfully executed scripts\02-locale.sh
[HOST: 10.40.240.193] 🔄 Disconnecting...
=== Execution Summary ===
HOST RESULT
10.40.240.189 Success
10.40.240.193 Success
🌟 Get Started with rconf Today!
If you’re looking for a straightforward, efficient way to manage remote script execution, rconf is the tool for you. It’s lightweight, secure, and easy to integrate into existing workflows.
🔗 Check out the rconf GitHub repository for more details!
Happy automating! 🚀