python exscript - ssh to device having issues with login buffer is empty

658 Views Asked by At

I'm just building my first login to a device script, and am having some issues, im getting the below error, all i have changed is the port no, but the issue seems to be with login, i have entered the correct user pass thats for sure.

Error:

Traceback (most recent call last):
  File "ssh.py", line 11, in <module>
    conn.login(account)                 # Authenticate on the remote host
  File "/usr/local/lib/python2.7/dist-packages/Exscript-2.1.503-py2.7.egg/Exscript/protocols/Protocol.py", line 627, in login
    self.authenticate(account, flush = False)
  File "/usr/local/lib/python2.7/dist-packages/Exscript-2.1.503-py2.7.egg/Exscript/protocols/Protocol.py", line 651, in authenticate
    self.app_authenticate(app_account, flush = flush)
  File "/usr/local/lib/python2.7/dist-packages/Exscript-2.1.503-py2.7.egg/Exscript/protocols/Protocol.py", line 819, in app_authenticate
    self._app_authenticate(account, password, flush, bailout)
  File "/usr/local/lib/python2.7/dist-packages/Exscript-2.1.503-py2.7.egg/Exscript/protocols/Protocol.py", line 723, in _app_authenticate
    raise TimeoutException(msg)
Exscript.protocols.Exception.TimeoutException: Buffer: ''

Config:

import hashlib
import Exscript

from Exscript.util.interact import read_login
from Exscript import Account
from Exscript.protocols import SSH2

account = read_login()              # Prompt the user for his name and password
conn = SSH2()                       # We choose to use SSH2
conn.connect('10.66.118.250', 3008) # Open the SSH connection to port 
conn.login(account)                 # Authenticate on the remote host
conn.execute('enable') 
conn.execute('conf t')              
conn.execute('interface g0/0/1')
conn.execute('description *** TEST ***')
conn.execute('end')
print conn.response

conn.execute('show ip route')
print conn.response

conn.send('exit\r')                 # Send the "exit" command
conn.close()
0

There are 0 best solutions below