Skip to main content

Hydra

Hydra is a command-line tool designed to execute commands on multiple remote hosts simultaneously via SSH. It streamlines workflows, automates repetitive tasks, and enhances efficiency for system administrators and developers managing distributed systems.

Features

  • Execute commands across multiple remote hosts concurrently
  • Supports flexible CSV-based host list configuration
  • SSH authentication with public key support
  • Lightweight and intuitive command-line interface
  • Color-coded output for easy host differentiation
  • Option to separate host outputs without interleaving
  • Handles cursor control codes for commands requiring specific layouts (e.g., fastfetch, neofetch)

Installation

System Requirements

  • Python 3.10 or higher
  • pip package manager
  • Required dependencies: asyncssh, argparse, asyncio
  • Optional: uvloop (Unix-like systems) or winloop (Windows) for enhanced performance

Installing via pip

Install Hydra directly using pip:

$ pip install hydra-ssh --user

Note: Ensure Python 3.10 or higher is installed on your system.

Usage

Hosts File Format

Create a hosts file in CSV format with the following structure:

#alias,ip,port,username,key_path
host-1,10.0.0.1,22,user,/home/user/.ssh/id_ed25519
host-2,10.0.0.2,22,user,#
  • Lines starting with # are ignored.
  • key_path:
    • Specify the path to an SSH private key.
    • Use # to use the default key provided via the -K option.
    • If # is used without -K, Hydra attempts to use common SSH keys from ~/.ssh/.

Running Commands

Execute a command on remote hosts with:

$ hydra-ssh [hosts file] [command]

Example:

$ hydra-ssh hosts.csv "uptime"

Options

  • -N, --no-color: Disable colorized output
  • -S, --separate-output: Display output from each host separately
  • -W, --terminal-width: Manually set terminal width
  • -E, --allow-empty-line: Permit printing of empty lines
  • -C, --allow-cursor-control: Enable cursor control codes (e.g., for fastfetch or neofetch)
  • -V, --version: Display Hydra version
  • -K, --default-key: Specify path to default SSH private key

License

The MIT License (MIT)

Copyright (c) 2023-2025 cwt(at)bashell(dot)com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for hydra-ssh 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hydra-ssh 1.0.2
File Size Uploaded
hydra_ssh-1.0.2.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for hydra-ssh 1.0.2
File Interpreter ABI Platform
hydra_ssh-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.6 MB

Release files / hydra_ssh-1.0.2.tar.gz

Download URL hydra_ssh-1.0.2.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c84736e93be562b8b364750dc3550a790afaff0313e14771db4e2f6b372febbd
BLAKE2b-256 checksum
How to use checksums
a00514ba6d6b01684ec4fc97b62ebb31ea97b378303686d522bfd4406174fcdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.2 Linux/6.13.8-200.fc41.x86_64

Release files / hydra_ssh-1.0.2-py3-none-any.whl

Download URL hydra_ssh-1.0.2-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
317358a45a7f6067f0580a532a3c1505e4b625282e951a93e0422afba1950ccc
BLAKE2b-256 checksum
How to use checksums
dadcebd1c6eb99c9cdd13693f201772c3a85b30f8eb3658b1a671828796e8a91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.2 Linux/6.13.8-200.fc41.x86_64

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page