Table of Contents

Distributed parallel appliance of system settings to multiple hosts

Problem

Run stupid administrative tasks in parallel on multiple machines.

Solution

Use “parallel-ssh” (former “pssh”)!

Example usage

Modify setting ALLOW_SSH_ROOT_USER=without-password in /etc/rkhunter.conf on multiple machines:

#!/bin/bash 
cmd="perl -pi~ -e 's/ALLOW_SSH_ROOT_USER=yes/ALLOW_SSH_ROOT_USER=without-password/' /etc/rkhunter.conf" 
parallel-ssh --par 1 --hosts hosts-file --user root --inline $cmd < /dev/null

We had to use --par 1, since the parallel execution of multiple ssh logins lead to some attempts being not successful. Maybe this is an issue with ssh-agent.

The issue about redirecting STDIN to /dev/null is described here: Issue 4: pssh cannot be used from a script?

Other parallel shell solutions