title: How to open a ssh connection using pxssh module in python
body: <p>i want to open a ssh connection from one server to another,so trying to use pxssh module for this.
  I am getting the following error while running the below code:</p>
  
  <p>My Code:</p>
  
  <pre><code>import pxssh
  s = pxssh.pxssh()
  if not s.login ('host','user','password'):
      print "SSH session failed on login."
  else:
      print "SSH session login successful"
      s.sendline ('ls -ltr')
      s.logout()
  </code></pre>
  
  <p>On running this code i am getting the following :</p>
  
  <pre><code>Traceback (most recent call last):
    File "ssh.py", line 20, in &lt;module&gt;
      if not s.login ('135.250.138.207','astro','astro'):
    File "/usr/lib/python2.6/site-packages/pxssh.py", line 243, in login
      if not self.synch_original_prompt():
    File "/usr/lib/python2.6/site-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/lib/python2.6/site-packages/pexpect.py", line 824, in read_nonblocking
      raise TIMEOUT ('Timeout exceeded in read_nonblocking().')
  pexpect.TIMEOUT: Timeout exceeded in read_nonblocking().
  </code></pre>
  
  <p>How can i successfully run the above code?</p>