Here is the code that I am using. For some reasons it is not working, what am I missing? Not sure what else I can add to my post but the site is asking me to add more details
account = Account(name= 'MiniMe', password = 'password')
conn = SSH2()
conn.debug=5
try:
print "Attempting a connection to 1.1.1.1"
conn.connect('1.1.1.1')
print (conn.response)
except:
e = sys.exc_info()[0]
print "Error connecting to host:", e
conn="N/A"
try:
print "Authenticating to 1.1.1.1"
conn.login(account)
print (conn.response)
except:
e = sys.exc_info()[0]
print e
conn.execute('ls -la')
print (conn.response)
The output looks like this
Attempting a connection to 1.1.1.1.
generic: Rejecting ssh-rsa host key for 1.1.1.1: 3432432j4k32j4k32j42j34kj432
generic: Attempting to authenticate MiniMe
generic: Authenticating with _paramiko_auth_password
None
Authenticating to 1.1.1.1
generic: Attempting to app-authenticate MiniMe.
generic: waiting for: ['[\\r\\n][^\\r\\n]*(?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)', 'login as:', '(?:s\\/key|otp-md4) (\\d+) (\\S+)', 'password:? *$', '[\\r\\n](?:[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\\ \\\t\\\n\\\r\\\x0b\\\x0c]*|[\\x1b\\x07\\x00]*)[\\[\\<]?\\w+(?:(?:(?:[\\w+\\-]+)\\@)?(?:[\\w+\\-\\.]+))?:?(?:(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)|~(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)?)?[: ]?(?:(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)|~(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)?)?(?:\\((?:[\\w\\+\\-\\._]+)\\))?[\\]\\-]?[#>%\\$\\]] ?[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\\ \\\t\\\n\\\r\\\x0b\\\x0c]*\\Z']
generic: Expecting a prompt
generic: Expected pattern: <generator object <genexpr> at 0x000000000349C990>
aix: Protocol: driver replaced: generic -> aix
aix: Protocol.app_authenticate(): driver replaced
aix: waiting for: ['[\\r\\n][^\\r\\n]*(?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)', 'login as:', '(?:s\\/key|otp-md4) (\\d+) (\\S+)', "[\\r\\n]\\w+\\'s Password: $", '[\\r\\n](?:[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\\ \\\t\\\n\\\r\\\x0b\\\x0c]*|[\\x1b\\x07\\x00]*)[\\[\\<]?\\w+(?:(?:(?:[\\w+\\-]+)\\@)?(?:[\\w+\\-\\.]+))?:?(?:(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)|~(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)?)?[: ]?(?:(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)|~(?:(?:(?:[\\w\\+\\-\\._]+))?(?:/(?:[\\w\\+\\-\\._]+))*/?)?)?(?:\\((?:[\\w\\+\\-\\._]+)\\))?[\\]\\-]?[#>%\\$\\]] ?[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\\ \\\t\\\n\\\r\\\x0b\\\x0c]*\\Z']
aix: Expecting a prompt
aix: Expected pattern: <generator object <genexpr> at 0x000000000349C9D8>
aix: Sending 'ls -la\r'
<class 'Exscript.protocols.Exception.TimeoutException'>
aix: Expecting a prompt
aix: Expected pattern: <generator object <genexpr> at 0x000000000349CAB0>