Blog

Man page of sshdo

sshdo

Section: User Commands (1)
Updated: July 2010
Index  

NAME

sshdo --- Execute remote commands or copies via SSH to multiple hosts.  

SYNOPSIS

sshdo [ -h | --help ] [ -v | --version ] [ -m | --man ] [ -mm | --mman ] [ -f | --force ] -u username [ [ -g | -p ] from to [ -s suffix ] ] [ 'remote command' ]  

DESCRIPTION

sshdo issues remote commands, puts or gets files to all hosts sequentially. Hosts are read from stdin (one per line). sshdo will use SSH key agent, if available, to avoid repetitive password entry.

WARNING: Be sure to validate your command before issuing it. One mistake duplicated across multiple hosts could be catastrophic. Backups are also recommended.  

OPTIONS

Options can be prefixed with either one or two hyphens, and can be abbreviated to any unique prefix. Thus, -v, -ver, and --version are equivalent.

[ -h | --help ]
Print usage and exit.
[ -v | --version ]
Print version number an exit.
[ -m | --man ]
Read man page. Goes to stdout.
[ -mm | --mman ]
Make man page. Sends nroff code to stdout.
[ -f | --force ]
Force use of dangerous command or file destination. For example issuing an rm or copying over /etc/passwd.
-u
username Username to use with SSH (e.g. username @hostname or -l username ).
-r
Recursive copy.
-g
Get files from remote location. Followed by from to the source and destination for file copies. Each get is suffixed by '-hostname'.
-p
Put files to remote location. Followed by from to. the ource and destination for file copies.
-s
suffix Save (redirect) output of remote command of each host to local separate file hostname-suffix.
 

EXAMPLES

sshdo -u wally free < hosts
Execute the command free on all hosts listed in the file called hosts. Authenticate using the user wally. The output of free from all hosts is sent to stdout.

sshdo -u wally -s free.txt free < hosts
Same as above but the output of free from all hosts is directed to a separate file, named hostname-free.txt for each host.
sshdo -p myscr.sh /usr/local/bin/
Copy local file myscr.sh to /usr/local/sbin on remote hosts. sshdo will wait for input, one host per line. Terminate input with ctrl-d.
 

SEE ALSO

ssh(1), ssh-agent(1), ssh-add(1), scp(1).  

AUTHOR

Neil H. Watson, www.watson-wilson.ca, neil-NOSPAM-@watson-wilson.ca  

LICENSE AND COPYING

Copyright 2007 Neil H. Watson

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details <http://www.gnu.org/licenses/>.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
SEE ALSO
AUTHOR
LICENSE AND COPYING
DOWNLOAD

This document was created by man2html, using the manual pages.
Time: 01:21:29 GMT, July 15, 2010