Netmiko: paramiko.ssh_exception.SSHException: Incompatible version (1.5 instead of 2.0)

Created on 8 Mar 2019  路  5Comments  路  Source: ktbyers/netmiko

Hi @ktbyers ,

I have a simple Python script using Netmiko to iterate through a list of hosts of various OS's, redirect to respective functions for each OS w/ the correct netmiko device_type / device commands, to collect syslog servers. Trouble is I have dozens of legacy IOS routers running only SSH v1. Many have an old IOS version that cannot support SSH v2 at all.

Have you come across a solution to allow SSH v1. Seems this is not possible by design for Paramiko.

Thank you!

multi_os_syslog_audit.py.txt

script output:

[root@cacti python_multi_os_syslog_updates]# python multi_os_syslog_updates.py

*** 2019-03-07 17:03:16 PST - starting multi oS device syslog audit now...***

mr1.xxxxxxx.xxxxxxx.net iosxr

logging XXX.XX.XX.XXX vrf default severity info port default
logging XXX.XX.XX.XXX vrf default severity info port default
logging XXX.XX.XX.XXX vrf default severity info port default

disconnected from mr1.xxxxxxxxxx.xxxxxxxxx.net now

br1.xxxxxxxxxx.xxxxxxxxx.net ios
No handlers could be found for logger "paramiko.transport"
Traceback (most recent call last):
File "multi_os_syslog_updates.py", line 314, in
device = ConnectHandler(device_type=platform, ip=host, username=username, password=password) #Connect to device
File "/usr/lib/python2.7/site-packages/netmiko/ssh_dispatcher.py", line 178, in ConnectHandler
return ConnectionClass(*args, kwargs)
File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 207, in __init__
self.establish_connection()
File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 689, in establish_connection
self.remote_conn_pre.connect(
ssh_connect_params)
File "/usr/lib/python2.7/site-packages/paramiko/client.py", line 392, in connect
t.start_client(timeout=timeout)
File "/usr/lib/python2.7/site-packages/paramiko/transport.py", line 545, in start_client
raise e
paramiko.ssh_exception.SSHException: Incompatible version (1.5 instead of 2.0)

Most helpful comment

Paramiko likely doesn't support 1.5. Have a read of this.

Your best bet would be to try issuing the ip ssh version 2 command on your devices, then running your script again.

All 5 comments

Paramiko likely doesn't support 1.5. Have a read of this.

Your best bet would be to try issuing the ip ssh version 2 command on your devices, then running your script again.

Nope, as @OzNetNerd nerd stated Paramiko doesn't support SSH version1.

SSH version2 is ~13 years old. I think SSHv1 also has some significant security issues. So nope we don't support it. I doubt we will ever support it.

Regards, Kirk

ok, @OzNetNerd & @ktbyers, thank you for confirming that. Just added a try & except for each function to create a list to be dealt with manually.

Exception: Incompatible version (2.99 instead of 2.0)
Traceback (most recent call last):
  File "/home/cacti/miniconda3/envs/ipam/lib/python3.7/site-packages/paramiko/transport.py", line 2039, in run
    self._check_banner()
  File "/home/cacti/miniconda3/envs/ipam/lib/python3.7/site-packages/paramiko/transport.py", line 2240, in _check_banner
    raise SSHException(msg.format(version))
paramiko.ssh_exception.SSHException: Incompatible version (2.99 instead of 2.0)

hey @ktbyers I get this error

@lutfisan It looks like you need to do the fix outlined here:

https://blog.rabin.io/sysadmin/ansible-cisco-ios-module-incompatible-version-2-99-instead-of-2-0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edurguti picture edurguti  路  7Comments

venkat1077 picture venkat1077  路  6Comments

NedySuprianto picture NedySuprianto  路  3Comments

ktbyers picture ktbyers  路  7Comments

Rooster-OC picture Rooster-OC  路  5Comments