Replies: 3 comments 3 replies
-
What is the Exception Stack trace you receive when you execute your code? |
Beta Was this translation helpful? Give feedback.
-
Which version of Netmiko are you using? |
Beta Was this translation helpful? Give feedback.
-
It should catch and re-raise the other Netmiko authentication exception here: https://github.com/ktbyers/netmiko/blob/v3.3.2/netmiko/base_connection.py#L953 I guess you could explicitly catch: Does your program actually crash when you run it? Kirk |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am new to python and attempting to write a script where part of it catches authentication failures. However, it doesn't catch the exception. The only exception my script catches are timed out exceptions.
Below is my debug log:
DEBUG:paramiko.transport:starting thread (client mode): 0x3a07118
DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_2.7.2
DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-OpenSSH_7.4
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_7.4)
DEBUG:paramiko.transport:kex algos:['ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'diffie-hellman-group14-sha1', 'diffie-hellman-group-exchange-sha256'] server key:['ssh-rsa', 'rsa-sha2-512', 'rsa-sha2-256', 'ecdsa-sha2-nistp256', 'ssh-ed25519'] client encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'aes128-cbc', 'aes192-cbc', 'aes256-cbc'] server encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'aes128-cbc', 'aes192-cbc', 'aes256-cbc'] client mac:['hmac-sha1', '[email protected]', 'hmac-ripemd160'] server mac:['hmac-sha1', '[email protected]', 'hmac-ripemd160'] client compress:['none', '[email protected]'] server compress:['none', '[email protected]'] client lang:[''] server lang:[''] kex follows?False
DEBUG:paramiko.transport:Kex agreed: ecdh-sha2-nistp256
DEBUG:paramiko.transport:HostKey agreed: ssh-ed25519
DEBUG:paramiko.transport:Cipher agreed: aes128-ctr
DEBUG:paramiko.transport:MAC agreed: hmac-sha1
DEBUG:paramiko.transport:Compression agreed: none
DEBUG:paramiko.transport:kex engine KexNistp256 specified hash_algo
DEBUG:paramiko.transport:Switch to new keys ...
DEBUG:paramiko.transport:Adding ssh-ed25519 host key for 172.18.233.31: b'ec900cbb3c9a755ef4370be9f9e4c08c'
DEBUG:paramiko.transport:userauth is OK
INFO:paramiko.transport:Authentication (password) failed.
DEBUG:paramiko.transport:EOF in transport thread
Hope someone can guide me in the right direction. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions