You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: