Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read Non Blocking error while using pxssh (ssh module for python)

Tags:

python

ssh

I am trying to do ssh on a remote machine using a python script using pxssh moudule.

Here are the lines of code that I use for the same :

    s = pxssh.pxssh()
    s.login (hostip,'root',auto_prompt_reset=False)

But this gives me the following TIMEOUT error.

  Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/pxssh.py", line 243, in login
    if not self.synch_original_prompt():
  File "/usr/local/lib/python2.6/dist-packages/pxssh.py", line 134, in synch_original_prompt
    self.read_nonblocking(size=10000,timeout=1) # GAS: Clear out the cache before getting the prompt
  File "/usr/local/lib/python2.6/dist-packages/pexpect.py", line 824, in read_nonblocking
    raise TIMEOUT ('Timeout exceeded in read_nonblocking().')
pexpect.TIME

OUT: Timeout exceeded in read_nonblocking().
like image 353
w2lame Avatar asked May 16 '11 02:05

w2lame


1 Answers

I have changed the python library and instead using paramiko which is much more stable and doesn't give the above error.

like image 152
w2lame Avatar answered Sep 24 '22 04:09

w2lame