• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A wrapper script for tmux to multiplex commands to ssh hosts

HOSTMUX

hostmux is a small wrapper script for tmux to easily connect to a series of hosts via ssh and open a split pane for each of the hosts. Using the synchronize-pane feature of tmux, commands can be easily broadcasted/multiplexed. This is a light weight replacement for tools like csshX on OS X.

Demo

Usage

HOSTMUX(1)                  General Commands Manual                 HOSTMUX(1)



NAME
       hostmux - Connects to a list of hosts via ssh in separate tmux split
       panes

SYNOPSIS
       hostmux [-h] | [-s session-name] [-l tmux-layout] [-c ssh command]
               [-o ssh options] [-f host_file] [-x] [-p] [-P]
               [-a] host1 [host2 ...]

DESCRIPTION
       Call hostmux followed by a list of hosts you want to connect to via
       ssh.  The script will create a new tmux session with a split pane for
       each specified host and connect to it.

       You can then use the synchronize-panes feature of tmux to
       multiplex/broadcast commands to all split panes / servers (see -a).

       Its arguments are as follows:

       -s -session-name
               Specify a name for the tmux session. It defaults to 'hostmux'
               which means that you can have only one hostmux session at a
               time if you don't specify unique names for your sessions

       -l -tmux-layout
               Specify a valid tmux layout e.g. even-horizontal, tiled, etc.
               It defaults to

       -f hostfile
               Specify a file which contains a newline separated list of
               [user@]host names. The hosts from the file will be merged with
               the hosts provided as optional arguments

       -x      Close the pane and/or session automatically when the ssh
               session exits successfully

       -p      Identify panes by setting the pane title to the ssh hostname
               (tmux >= 2.3), may not work if the remote host does $PS1 magic
               like setting the terminal title, in that case use -P

       -P      Identify panes by setting the remote prompt $PS1 to
               "[<hostname>]$ " after login

       -a      Synchronize all panes, i.e. type commands simultaneously in all
               panes

       -c      Specify the ssh command. It allows to use a specific wrapper.
               It defaults to "ssh"

       -o      Specify ssh options to play at connection such as a user (-l)
               or a connexion port (-p), etc

       -h      Display usage information

       host    Specify a space separated list of one or more user@hostname ssh
               targets. This is what you would pass to the ssh command when
               you are connecting to a host. Currently there is no support for
               passing additional flags to ssh. If you do need them, add them
               to your ~/.ssh/config

SEE ALSO
       tmux(1)

       https://github.com/hukl/hostmux

EXIT STATUS
       The hostmux utility exits 0 on success, and >0 if an error occurs.

AUTHORS
       hostmux was written by John-Paul Bader (hukl), [email protected].



sh                             February 6, 2017                     HOSTMUX(1)

TMUX Keybindings

The following key bindings can be added to your .tmux.conf for even more convenience.

# This toggles the synchronize-panes feature, or use hostmux -a.
bind-key a set-window-option synchronize-panes
# This allows killing the whole session, or use hostmux -x
bind-key X kill-session

Installing on OS X via Homebrew

brew install hukl/tap/hostmux

Installing the ZSH completion

This repo contains a zsh completion file which needs to be added to your other zsh completions.

Find or create an appropriate directory, copy the completion file and if the directory isn't already in your $fpath then add this to your .zshrc:

# Extend Autocomplete Search Path
fpath=(/path/to/your/completions/dir $fpath)

Building / Installing the manpage

Build man/hostmux.1 (roff format) with the Makefile from hostmux.mandoc (BSD default mandoc format) using mandoc (Debian: apt-get install mandoc). Copy it to your local man page folder e.g. /usr/local/share/man/man1/hostmux.1

Suggestions for Improvement?

Let me know!

More Repositories

1

Smyck-Color-Scheme

Color Scheme for Terminal.app, iTerm2, Vim, MacVim, Sublime Text2 and Textmate
Vim Script
1,132
star
2

freebsd-toolbox

Collection of Tools and Howtos
Shell
217
star
3

dotfiles

Collection of various config files
Vim Script
163
star
4

shortcut.io_old

Fast and Simple Bookmark Service
JavaScript
108
star
5

Bitturret

Bittorrent Tracker written in Erlang
Erlang
30
star
6

Unix-Toolbox

Unix Toolbox - Useful commands for Linux and FreeBSD by Colin Barschel
25
star
7

cccms

Creative Chaos Content Management System
Ruby
23
star
8

checklist_generator

Little project to create Airbus Style Checklists
JavaScript
16
star
9

rstats

Re-implementing R's native poisson and exponential distribution sampling
C
13
star
10

macos-toolbox

collection of useful macOS related things
13
star
11

fancyapi

Code Samples for Screencast
Erlang
11
star
12

fefe.css

CSS fΓΌr blog.fefe.de
CSS
9
star
13

vim-setup

Vim config files
Vim Script
8
star
14

localey

Experimental Rails 3 plugin which makes it easy to encode the locale within the url instead of appending it as query param. Alternative to svenfuchs routing-filter.
Ruby
6
star
15

wwworld

My Wordpress Theme for
PHP
6
star
16

thumbnerl

Experimental Project to create screenshots from websites with erlang, phantomjs and imagemagick
Erlang
6
star
17

righttp

A HTTP client library written from scratch, offering an easy interface with lots of flexibility
Ruby
6
star
18

Cubino

Source code examples mentioned on cubino.tumblr.com
Java
5
star
19

Mibo

Miniblog with sinatra - playing with ruby is fun!
Ruby
5
star
20

geo_foo

Rails Interface to Postgis
Ruby
5
star
21

ees

Easy Erlang Scaffold
Ruby
4
star
22

cccash

Chaos Cashbox System 2.0
Ruby
4
star
23

shortcut.io

Erlang
3
star
24

favicon_streamer

Sniffs http traffic and looks for favicon urls which are being pushed to a web page via server sent events to make nice insecurity awareness visuals with latest and greatest web technology
Erlang
3
star
25

CCCB-Webdisplay

Simple Webinterface for Airport Display
Ruby
3
star
26

munchies

Reads last five minutes of log files and yields the lines for munin modules
Ruby
3
star
27

watchr_setup

Watchr config + files replacing autotest for rails3 / ruby1.9
Ruby
2
star
28

erlang_experiments

Personal Erlang Experiments
Erlang
2
star
29

Arduino-Experiments

Playing around with Arduino and anything else
C++
2
star
30

freebsd-patches

Collection of FreeBSD Enhancements. SVN Mirror. Code by Cryx
C
2
star
31

hostbackup

Backups arbitrary files from remote hosts and stores them into a git repo
Ruby
2
star
32

shellscripts

Collection of Shellscripts
Shell
2
star
33

blogmi

Sick of wordpress? Just want to blog? Me too!
Ruby
2
star
34

poignantguide

This is a dump of poignantguide.net with all its assets found on archive.org, googles and yahoo's cache using warrick.pl. Links have to be rewritten
2
star
35

aduri

Airport Display UDP Ruby Interface
Ruby
1
star
36

testi

testi
1
star
37

homebrew-tap

Collection of custom formulas
Ruby
1
star
38

plsignr

Project to checkout github pages
1
star
39

google_signed_url

Generates signed URLs for Google Cloud Storage without depending on gcloud/gsutil
Elixir
1
star
40

testing-sinatra

something is wrong here. what is it?
Ruby
1
star
41

sound-experiments

Experiments with digital audio
Erlang
1
star
42

sparkletest

1
star
43

early

Erlang Bootstrap Experiments - maybe
1
star
44

cccms2

yup its time for a rails 3.0 rewrite :D
Ruby
1
star
45

cccash2

CCCASH 2.0
Ruby
1
star
46

log_replay

Parses rails logfiles and yields them with or without timings
Ruby
1
star
47

reaper_osc_action

A Streamdeck Plugin to send OSC Commands to Reaper
CSS
1
star