Skip to content

PSSH

homepage-banner

What is PSSH?

PSSH stands for Parallel SSH, and it is a command-line tool that allows you to run SSH commands on multiple servers simultaneously. PSSH is an open-source tool that is available for Linux, macOS, and Windows. With PSSH, you can run commands on a large number of servers, and the tool will distribute the commands across all machines.

Usage

execute local script on remote machines with pssh

Special characters in the target command may cause problems when executing in batches with pssh. In this case, you can consider using a script and redirection to execute remotely.

pssh -h RemoteHosts.ip -P -I < ~/LocalScript.sh

Skip strict host key check in pssh

When using pssh to manage machines in batches, in order to avoid entering yes to confirm host key checking, you can add the following ssh parameter:

pssh -O "StrictHostKeyChecking=no" -O "UserKnownHostsFile=/dev/null"

Batch send/retrive file with pscp/pslurp

send files/dir

pscp -h ip.file local_file remote_dir
## eg.
pscp -h hosts.ip file.txt ~/

receive files/dir

pslurp -h ip_file -L local_dir  remote_file local_file

Reference

  • https://linux.die.net/man/1/pssh
  • https://www.cyberciti.biz/cloud-computing/how-to-use-pssh-parallel-ssh-program-on-linux-unix/
  • https://github.com/lilydjwg/pssh
  • https://www.tecmint.com/execute-commands-on-multiple-linux-servers-using-pssh/
  • https://pypi.org/project/pssh/
  • https://command-not-found.com/pscp.pssh
  • https://tonydeng.github.io/2014/12/08/pssh/
  • https://www.geeksforgeeks.org/pssh-linux-comman/

Some of the content is generated by AI, please be cautious in identifying it.

Leave Your Message