Description
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
Host anyhostname (you can give any hostname)
HostName (Host IP address)
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p.socket
ControlPersist 30m
and when I try to call this in the parallel SSH script
from pssh.clients import ParallelSSHClient
host = ['anyhostname']
cmd = 'uptime'
client = ParallelSSHClient(host, user='root', password='password')
#client = ParallelSSHClient(host, user='root')
#client = ParallelSSHClient(host, pkey='~/.ssh/config')
output = client.run_command(cmd)
for host_out in output:
for line in host_out.stdout:
print(line)
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