Skip to content

cinemapub/bf_multissh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bf_multissh

Execute bash command on multiple servers at once

Example

run "uname -a" on 3 hosts, one by one

multissh.sh host1,host2,host3 "uname -a"

run "uname -a" on 3 hosts, all at the same time

multissh.sh -b host1,host2,host3 "uname -a"

run "uname -a" on 3 hosts, using username 'admin'

multissh.sh -u admin host1,host2,host3 "uname -a"

run a number of commands on several hosts

cat commands.sh | multissh.sh admin@host1,root@host2 -

Usage

multissh.sh [options] [host1,host2,host3] [command]
  runs [command] on all specified hosts via ssh
  [host] can be ip address, hostname or user@hostname
  [options]:
	-b        : start in background (so +- simultaneously on all servers)
	-i        : do SSH initialisation (copy SSH pub key to remote host if necessary)
	-u [user] : use this username for shh login (default: peter)

Requirements

* bash
* sed/tr/grep (should be present in your OS if sh/bash is there)
* ssh
* gawk (optional)

About

Execute bash command on multiple servers via ssh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages