Closed chikkujimmy closed 2 years ago
Hi there,
Thanks for the interest.
The quickstart documentation describes how to use ParallelSSHClient. This project does not read ~/.ssh/config, nor does it support an SSH config as argument to pkey
.
from pssh.clients import ParallelSSHClient
hosts = ['localhost', 'localhost', 'localhost', 'localhost']
client = ParallelSSHClient(hosts)
cmd = 'uname'
output = client.run_command(cmd)
for host_out in output:
for line in host_out.stdout:
print(line)
Multiplexing is not supported nor needed for this library. Simply keep the client
object in scope to reuse the same connection.
I tried using SSH multiplexing (to speed up remote login procedure) by creating a config file in the path ~/.ssh/config with the below content
and when I try to call this in the parallel SSH script
it is giving an error pssh.exceptions.UnknownHostError: ('Unknown host %s - %s - retry %s/%s', 'anyhostname', 'Temporary failure in name resolution', 3, 3).
But when I try the command line I am able to connect via Parallel SSH
$ parallel-ssh -i -l user1 -o StrictHostKeyChecking=no -h ~/pssh-hosts uptime [1] 16:19:49 [SUCCESS] local-250 16:19:49 up 13:55, 2 users, load average: 23.52, 35.55, 51.63
How can I specify the multiplexing hostnames or implement multiplexing in your parellel SSH script? As per your documentation there are options for password and private key accesses which are working fine