cssh Code
Status: Beta
Brought to you by:
mrkafk
File | Date | Author | Commit |
---|---|---|---|
INSTALL | 2010-07-08 | mrkafk | [r1] initial |
cssh.py | 2010-07-08 | mrkafk | [r1] initial |
readme.txt | 2010-07-08 | mrkafk | [r1] initial |
cssh - Concurrent SSH ===================== This is cssh, Concurrent SSH client. Why cssh? ========= I've used pssh and shmux, but I've been annoyed with poor customization of those programs, like inflexible IPs/hostnames specification or simultaneous spawning threads for all the hosts (pssh), which is a problem with many hosts, or having to download/upload files with a separate command.1 I wrote cssh.py to resolve such problems. You get: - a fixed (configurable) length queue of active SSH threads - specifying IPs/hostnames in 3 ways: on the commandline, in a specified file (-f), or "ipset" in a configuration file (-i ipset); all 3 ways can be combined together in a single command - configurable username, password and SSH port per host (only in ipsets, though) - simultaneous download and upload of files/dirs (using built-in SCP implementation), again with configurable queue length - ability to upload and execute script with one switch (-s) - many other useful options, like additional saving cmd outputs in a separate file for each machine (-d output_dir), or suppressing printing out hosts for which given command produced no output (-b) Installation ============ See INSTALL file. Example usage ============= Help: # cssh.py -h Create default .cssh.rc file: # cssh.py -0 > ~/.cssh.rc See ~/.cssh.rc, and add named ipsets, like: linuxes = 192.168.1.1, 192.168.1.5 root secretpass 2222, --ip 192.168.1.23 --port 2345 Use ipset for command: # cssh.py -c "ps|wc" -i linuxes Save output to a "outdir" directory: # cssh.py -c "ps|wc" -a outdir -i linuxes Download /tmp/result file from "linuxes" # cssh.py -d /tmp/result -a result_dir -i linuxes Upload a file to /usr/local/bin on "linuxes": # cssh.py -y somefile -g /usr/local/bin -i linuxes