Skip to content

bepisdev/sshmux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sshmux

Rust

Run a shell command concurrently on multiple SSH hosts defined in a TOML config.

Features

  • 🧹 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, and identity_file settings.
  • 🛠️ --check-config mode to validate configs before running.
  • 🛡️ Optional --force flag to allow duplicate hosts.

Installation

Requirements

Build & Install

git clone https://github.com/yourusername/sshmux.git
cd sshmux
make
sudo make install

This will install sshmux to /usr/local/bin/.


Configuration

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.


Usage

sshmux --config sshmux.toml

Options

-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

Example

sshmux -c ./sshmux.toml -v

Or just to validate the config:

sshmux --check-config

License

MIT © Josh Burns

About

SSH command muxer

Resources

Stars

Watchers

Forks

Packages

No packages published