2017-07-11 14:02:25 -04:00
|
|
|
# pssh
|
|
|
|
|
2017-09-08 05:13:59 +01:00
|
|
|
> Parallel SSH program.
|
meshlabserver, nkf, obs, pax, pdfimages, pinky, pssh, s, sd, sendmail, sftp: add link (#6971)
2021-10-17 06:23:56 +02:00
|
|
|
> More information: <https://manned.org/pssh>.
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2017-09-08 05:13:59 +01:00
|
|
|
- Run a command on two hosts, and print its output on each server inline:
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`pssh {{[-i|--inline]}} {{[-H|--host]}} "{{host1}} {{host2}}" {{hostname --ip-addresses}}`
|
2017-07-11 14:02:25 -04:00
|
|
|
|
|
|
|
- Run a command and save the output to separate files:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`pssh {{[-H|--host]}} {{host1}} {{[-H|--host]}} {{host2}} {{[-o|--outdir]}} {{path/to/output_dir}} {{hostname --ip-addresses}}`
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2017-09-08 05:13:59 +01:00
|
|
|
- Run a command on multiple hosts, specified in a new-line separated file:
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`pssh {{[-i|--inline]}} {{[-h|--hosts]}} {{path/to/hosts_file}} {{hostname --ip-addresses}}`
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2017-09-08 05:13:59 +01:00
|
|
|
- Run a command as root (this asks for the root password):
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`pssh {{[-i|--inline]}} {{[-h|--hosts]}} {{path/to/hosts_file}} {{[-A|--askpass]}} {{[-l|--user]}} {{root_username}} {{hostname --ip-addresses}}`
|
2017-07-11 14:02:25 -04:00
|
|
|
|
|
|
|
- Run a command with extra SSH arguments:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`pssh {{[-i|--inline]}} {{[-h|--hosts]}} {{path/to/hosts_file}} {{[-x|--extra-arg]}} "{{-O VisualHostKey=yes}}" {{hostname --ip-addresses}}`
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2017-09-08 05:13:59 +01:00
|
|
|
- Run a command limiting the number of parallel connections to 10:
|
2017-07-11 14:02:25 -04:00
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`pssh {{[-i|--inline]}} {{[-h|--hosts]}} {{path/to/hosts_file}} {{[-p|-par]}} {{10}} '{{cd dir; ./script.sh; exit}}'`
|