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.
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]
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
parallel-ssh -i -h hosts uptime
parallel-scp -h hosts sample.txt /home/user_home_dir/
parallel-rsync -h hosts sample.txt /home/user_home_dir/