Run a shell command concurrently on multiple SSH hosts defined in a TOML config.
- 🧹 Run any shell command over SSH on multiple hosts concurrently.
- 🎨 Color-coded output for clarity.
- ✅ Config validation (with unknown key rejection and duplicate host detection).
- 💪 Supports per-host
user
,port
, andidentity_file
settings. - 🛠️
--check-config
mode to validate configs before running. - 🛡️ Optional
--force
flag to allow duplicate hosts.
- Rust (https://rustup.rs)
- OpenSSH installed and available on your system
git clone https://github.com/yourusername/sshmux.git
cd sshmux
make
sudo make install
This will install sshmux
to /usr/local/bin/
.
Create a sshmux.toml
file in the same directory or specify a path via --config
.
command = "uptime"
[timeouts]
connection_timeout = 30
command_timeout = 30
[[hosts]]
host = "192.168.1.10"
user = "josh"
port = 22
identity_file = "~/.ssh/id_rsa"
[[hosts]]
host = "192.168.1.11"
[[hosts]]
host = "192.168.1.10"
user = "admin"
⚠️ By default, duplicate hosts will trigger a validation error. Use--force
to allow duplicates.
sshmux --config sshmux.toml
-c, --config <PATH> Path to config file (default: sshmux.toml)
-v, --verbose Enable verbose output
--check-config Only check the config for validity and exit
--force Allow duplicate hosts in the config
--connection-timeout <DURATION> Specify connection timeout in seconds
--command-timeout <DURATION> Specify command timeout in seconds
sshmux -c ./sshmux.toml -v
Or just to validate the config:
sshmux --check-config
MIT © Josh Burns