The software allows execution of a script simultaneously on multiple hosts.
* Generating an SSH public/private key pair through ssh-keygen.
* Copying your public key(s) to $HOME/.ssh/authorized_keys on all remote hosts on which the user is planning to run commands or scripts with netrun. If the user plans to access remote hosts with different accounts, they will need to verify that their public key(s) have been added to each account's authorized_keys file. This action must be done with care, checking the local computer security policy, and getting permission from the affected users before performing the task.
* Starting an ssh-agent and loading your private keys with ssh-add.
Netrun performs several steps for each hostname, IP address, or CIDR style subnet given on the command-line:
1. Connects to port 22 and captures the SSH version string, confirming that the remote sshd is up and accessible. Hosts are skipped if this step takes longer than 15 seconds (or the connection timeout specified by -c) to complete.
2. Attempts to establish an SSH connection and run an interpreter (the default is /bin/sh).
3. Feeds the script file (specified with -s) or command string (specified with -e) and an optional data file (specified with -d) to the standard input of the interpreter.
4. Captures stdout and stderr of the interpreter to log files. By default, these log files are stored in ./netrun.PID. However, an alternate log directory may be specified via -L. If the user running netrun does not have both write and search permissions to the log directory, netrun exits with an error message.
5. Displays a report that summarizes the status of the attempted actions.
The synopsis of Netrun is presented as follows:
netrun [-hqRS]] [-c connect timeout] [-f max forks] [-i interpreter] [-s script file] | [-e script] [-d data file] [-l login name] [-L log dir] [-t timeout] hosts ...
In summary, Netrun is an efficient and convenient Perl module that allows users to execute commands or scripts on multiple remote hosts while capturing output and error messages. This tool is powered by ssh and assumes that certain steps will have been accomplished before use. Netrun performs several steps for each hostname, IP address, or CIDR style subnet given on the command-line and displays a report that summarizes the status of attempted actions.
Version 1.20: N/A