User Tools

Site Tools


linux:ubuntu_parallel_ssh

Ubuntu Pssh Install

Pssh allows you to run ssh commands and more on multiple hosts.

apt install pssh

Note: This is from the readme documentation.

To avoid any conflicts with the putty package, all of the programs have been renamed.

  • parallel-ssh is pssh
  • parallel-scp is pscp
  • parallel-rsync is prsync
  • parallel-nuke is pnuke
  • parallel-slurp is pslurp

Config files

Create a hostfile to use with pssh

touch /home/user/.ssh/hosts

In the above hostfile add hosts as username@ip or username@hostname example:

ansible@hostname
[email protected]

pssh private key

If you need a private key in order to connect you need a config file in your

touch /home/user/.ssh/config

The config file can have multiple hosts with multiple keys example:

Host *.mgt
StrictHostKeyChecking no
IdentityFile ~/.ssh/some_private_key

Host wonka.mgt
StrictHostKeyChecking no
IdentityFile ~/.ssh/another_private_key

Host xxx.xxx.xxx.xxx
StrictHostKeyChecking no
IdentityFile ~/.ssh/another_private_key

Test If Pssh Works

parallel-ssh -i -h hosts uptime

Test If Pscp Works

parallel-scp -h hosts sample.txt /home/user_home_dir/

Test If Prsync Works

parallel-rsync -h hosts sample.txt /home/user_home_dir/
linux/ubuntu_parallel_ssh.txt · Last modified: 24/11/2023 12:14 by Allan