Skip to content

SSH2 login failed #160

@memogharib

Description

@memogharib

import Exscript
from Exscript.protocols import SSH2,Account
device = SSH2(debug=9)
acc = Account("xxxx","xxxxx")
device.connect("HOST1",port=9090)
print device.response
print device.get_remote_version()
print device.get_banner()
print device.is_dummy()
device.login(acc)
print device.response

'''''''''''''''''''' output 👍

generic: Rejecting ssh-rsa host key for HOST1: 5cf53be5446cb97a4941aad09e3b29a8
None
SSH-2.0-OpenSSH_4.3
None
False
generic: Attempting to authenticate xxxx
generic: auth_none failed, supported: [u'publickey', u'password']
generic: Rejecting ssh-rsa host key for HOST1: 5cf53be5446cb97a4941aad09e3b29a8
generic: Authenticating with _paramiko_auth_agent
generic: Authentication with _paramiko_auth_agent failed: auth agent found no keys
generic: Rejecting ssh-rsa host key for HOST1: 5cf53be5446cb97a4941aad09e3b29a8
generic: Authenticating with _paramiko_auth_autokey
generic: Authentication with _paramiko_auth_autokey failed: Failed to authenticate with given username and password/key
generic: Rejecting ssh-rsa host key for HOST1: 5cf53be5446cb97a4941aad09e3b29a8
generic: Authenticating with _paramiko_auth_password
generic: Attempting to app-authenticate tarek.anis.
generic: waiting for: ['[\r\n][^\\r\\n]*(?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)', '(user ?name|user|login): $', u'(?:s\/Key|otp-md5) (\d+) (\S+)(?=\s|[\r\n])', '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: ["'[\\r\\n][^\\\\r\\\\n]
(?:bad secrets|denied|invalid|too short|incorrect|connection timed out|failed|failure)'", "'(user ?name|user|login): *$'", "u'(?:s\\/Key|otp-md5) (\\d+) (\\S+)(?=\\s|[\\r\\n])'", "'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'']
ericsson_ban: Protocol: driver replaced: generic -> ericsson_ban
ericsson_ban: Protocol.app_authenticate(): driver replaced
ericsson_ban: waiting for: ['Login failed', 'user:', u'(?:s\/Key|otp-md5) (\d+) (\S+)(?=\s|[\r\n])', 'pass:', '[\r\n][\-\w+\.]+(?:\([^\\)]+\))?[%#] ?$|(?:\(y/n\)\[n\])']
ericsson_ban: Expecting a prompt
ericsson_ban: Expected pattern: ["'Login failed'", "'user:'", "u'(?:s\\/Key|otp-md5) (\\d+) (\\S+)(?=\\s|[\\r\\n])'", "'pass:'", "'[\\r\\n][\\-\\w+\\.]+(?:\\([^\\\\)]+\\))?[%#] ?$|(?:\\(y/n\\)\\[n\\])'"]

Traceback (most recent call last):
File "C:/Python27/ssh test.py", line 11, in
device.authenticate(acc)
File "C:\Python27\lib\site-packages\Exscript\protocols\protocol.py", line 699, in authenticate
self.app_authenticate(app_account, flush=flush)
File "C:\Python27\lib\site-packages\Exscript\protocols\protocol.py", line 868, in app_authenticate
self._app_authenticate(account, password, flush, bailout)
File "C:\Python27\lib\site-packages\Exscript\protocols\protocol.py", line 772, in _app_authenticate
raise TimeoutException(msg)
TimeoutException: Buffer: u''

'''''''''''''''' please is there are any solution for it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions