ParallelSSH / parallel-ssh

Asynchronous parallel SSH client library.
https://parallel-ssh.org
GNU Lesser General Public License v2.1
1.21k stars 149 forks source link

error using simple example #87

Closed steelliberty closed 7 years ago

steelliberty commented 7 years ago

I set the example given in the repository -- from pprint import pprint from pssh.pssh_client import ParallelSSHClient

hosts = [hostname] client = ParallelSSHClient(hosts,user=username,password=password)

output = client.run_command('ls -ltrh') pprint (output)

i included the password because I believe it will allow access to my encrypted SSH pkey.

pssh.exceptions.SSHException: ("General SSH error - Error reading SSH protocol banner('This operation would block forever', <Hub at 0x10ab517d0 select pending=0 ref=0>)", 'nononanananoka.com', 22)

pkittenis commented 7 years ago

Hi there,

Thanks for the interest.

Can you please provide a complete code sample that replicates the issue?

These kind of errors are usually caused by imports of the standard library before pssh, which breaks patching - see note in quickstart documentation.

Here is what the below code outputs, in latest version:

from pprint import pprint
from pssh.pssh_client import ParallelSSHClient

hosts = ['localhost']
client = ParallelSSHClient()

output = client.run_command('ls -ltrh')
pprint (output)

for line in output['localhost'].stdout:
    print line

Output

{'localhost': 
    host=localhost
    exit_code=None
    cmd=<Greenlet at 0x7f971e1b24b0>
    channel=<paramiko.Channel 0 (open) window=2097152 -> <paramiko.Transport at 0x1e1abb50L (cipher aes128-ctr, 128 bits) (active; 1 open channel(s))>>
    stdout=<generator object read_output_buffer at 0x7f971e15c6e0>
    stderr=<generator object read_output_buffer at 0x7f971dee93c0>
    stdin=<paramiko.ChannelFile from <paramiko.Channel 0 (open) window=2097152 -> <paramiko.Transport at 0x1e1abb50L (cipher aes128-ctr, 128 bits) (active; 1 open channel(s))>>>
    exception=None
}

total XXM
rdwx-------- <..>
<..>
pkittenis commented 7 years ago

Hi @steelliberty - has the problem been resolved? If not, can you please show a code example to replicate and will take a look.

steelliberty commented 7 years ago

I have resolved the issue. It was related to my failure to add location for my know-hosts file. Thank you for the follow up.

jack

On Sat, Jul 29, 2017 at 1:39 PM, Dan notifications@github.com wrote:

Hi @steelliberty https://github.com/steelliberty - has the problem been resolved? If not, can you please show a code example to replicate and will take a look.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ParallelSSH/parallel-ssh/issues/87#issuecomment-318846473, or mute the thread https://github.com/notifications/unsubscribe-auth/AE4HdilHTKrKVmzQsM34UtlAY85Sa6k6ks5sS25LgaJpZM4OgTJo .