Operations 4 min read

Master Parallel SSH (PSSH): Run Commands, Transfer Files, Sync Servers

This guide explains how to use Parallel SSH (PSSH) to execute commands, copy files, and synchronize directories across multiple servers, including installation steps and configuring password‑less SSH for streamlined server management.

Java High-Performance Architecture
Java High-Performance Architecture
Java High-Performance Architecture
Master Parallel SSH (PSSH): Run Commands, Transfer Files, Sync Servers

PSSH stands for Parallel SSH, allowing a single command to be executed simultaneously on multiple servers, simplifying cluster management.

Example to view load on all servers: pssh -h hostlist -i w where hostlist is a text file listing servers, e.g.:

[email protected]:22
[email protected]:22

PSSH examples

Copy a local file to all servers:

pscp -h hostlist /root/fileA /tmp/fileA

Copy a file from all servers to the local machine:

pslurp -h hostlist -L /tmp/test /home/err_log log

Synchronize a local directory to each server:

prsync -h hostlist -a -r /tmp/test /home

PSSH installation

Download:

https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz

Extract: tar xzvf pssh-2.3.1.tar.gz Install: cd pssh-2.3.1 && python setup.py install Test: pssh --help and run a command, e.g.

pssh -H [email protected] -A -i date

Configure password‑less SSH

Generate a key pair with ssh-keygen (accept defaults), then copy the public key to each server: ssh-copy-id -i /root/.ssh/id_rsa -p 22 [email protected] After copying keys, subsequent pssh commands no longer prompt for a password.

PSSH is lightweight, easy to install, and can dramatically speed up routine server‑administration tasks.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Automationfile transferserver managementpsshparallel-ssh
Java High-Performance Architecture
Written by

Java High-Performance Architecture

Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.