Skip to main content

SSH into multiple hosts.

Project description

SSH Multi v2.1.2. SSH into multiple machines at once.


Get a count of processes on each server:

$ sshm,,,mail[01-05],host[01-25].org “ps aux | wc -l”

Check if postfix is running on mail servers:

$ sshm “postfix status”

Verify which servers are accepting SSH connections:

$ sshm example[1-5,8].com “exit”

Copy a file to several servers (may not work for larger files):

$ cat some_file | sshm example[1-5].com “cat > some_file”

Specify a per-host port:

$ sshm,, “exit”

Specify multiple groups of servers, the last positional argument is assumed to be the command.

$ sshm,mail[03-5] “uptime”

Format the command per-host:

$ sshm example[1-3].com “echo {fqdn}”

sshm: sshm: sshm:
Possible formatting variables:
uri, fqdn, subdomain, num

Quiet SSH’s error output (-q is passed to the SSH command):

$ sshm -u “echo {subdomain}”

(ssh -q echo example)

Any arguments not recognized by SSHM will be passed to ssh:

$ ssh “ls” -o StrictHostKeyChecking=no

Attempt to get hostnames of the entire subnet, do not store keys found, do not ask about keys found, do not prompt for password, timeout connection after 1 second, tell ssh to not display any error output. This command will take several days, and is not secure because all keys are ignored:

$ sshm -q 10.0-255.0-255.0-255 “hostname” -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -oBatchMode=yes -oConnectTimeout=1

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
sshm-2.1.2-py2.7.egg (17.5 kB) Copy SHA256 hash SHA256 Egg 2.7 Aug 11, 2016
sshm-2.1.2-py3.2.egg (17.7 kB) Copy SHA256 hash SHA256 Egg 3.2 Aug 11, 2016
sshm-2.1.2-py3.3.egg (17.8 kB) Copy SHA256 hash SHA256 Egg 3.3 Aug 11, 2016
sshm-2.1.2-py3.4.egg (17.7 kB) Copy SHA256 hash SHA256 Egg 3.4 Aug 11, 2016
sshm-2.1.2.tar.gz (7.7 kB) Copy SHA256 hash SHA256 Source None Aug 11, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page