The sys admin's daily grind: parallel SSH
Parallel SSH is the name of an easy-to-configure tool that our resident sys admin, Charly, now routinely deploys whenever he needs to launch the same programs, copy the same files, or kill the same processes simultaneously on multiple computers.
I am writing from a Linux seminar in the Linuxhotel in Essen, Germany. The environment here comprises four Xen virtualized machines. Identical changes to all cluster nodes are a regular requirement, which is a pain, but I have a utility up my sleeve: parallel SSH . Pssh relies on the SSH agent running, so I'll take care of that first:
After I enter the pass phrase for my SSH key, the AAH agent ensures that nobody will ask me for it, at least not during the current session. Next, I need a text file in which I add the IP addresses of the servers for which I need to set up simultaneous connections, so I'll start by adding three addresses to server.txt:
192.168.5.12 192.168.5.52 192.168.5.67
First, I will open an SSH connection to these three computers, run the uname command on them, and redirect the output to my pssh-out directory with the command line:
pssh -h server.txt -l charly -o /home/charly/pssh-out uname
Now I have three files below /home/charly/pssh-out named after the server IP addresses. And lo and behold, the files contain the uname command output (Figure 1). Pssh is thus similar to the Distributed Shell (DSH).
Two Hard-Hitting Tools
PSCP and PNuke, which are also part of the pssh package, work along the same principle.
PSCP copies files simultaneously to multiple target machines. This command adds a new message of the day to my servers:
pscp -h server.txt -l charly /etc/motd /etc/
PNuke sends a kill -9 to identically named processes on three servers
pnuke -l server.txt -l charly wget
and terminates any wget processes running on them. This frees up some bandwidth.
Brilliant. The most difficult thing about the pssh suite is saying its Internet page name, theether.org, without tripping over your own tongue.
- Parallel SSH: http://www.theether.org/pssh/
Version 16 of the popular Linux desktop reveals new tools, edge-snapping, and performance improvements.
Symantec says Linux-Darlioz burrows in through PHP.
Dell renews its quest for the ultimate developer machine.
Innovative back door looks like normal SSH traffic.
One of CeBITs most successful forums opens the new year with a new name. The popular Open Source Forum continues in 2014 under the name Special Conference: Open Source. This year, the forum will be bigger and offer a wider range of possibilities for sponsors.
New release offers better graphics drivers and expands filesystem support.
New mail protocol will shut out the NSA and prevent snooping on metadata.
A new web application helps users visualize distributed denial-of-service attacks.
Ubuntu 13.10 takes a step toward convergence, with lots of mobility, but Mir only partly here.
Galileo board is targeted to embedded developers and educational institutions.