cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2129
Views
15
Helpful
2
Replies

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

write_erase
Level 1
Level 1

I have no issue SSH manually from Linux client to Cisco Router.

However when I try to connect to the same Router using Python netmiko, the following error occurred.

>>> from netmiko import ConnectHandler
>>> R1 = {
...     'device_type': 'cisco_ios',
...     'ip': '10.10.10.10',
...     'username': 'u',
...     'password': 'p'
... }
>>> 
>>> net_connect = ConnectHandler(**R1)
Exception: Incompatible version (2.99 instead of 2.0)
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.7/site-packages/paramiko/transport.py", line 2039, in run
    self._check_banner()
  File "/home/user/.local/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)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.7/site-packages/netmiko/ssh_dispatcher.py", line 259, in ConnectHandler
    return ConnectionClass(*args, **kwargs)
  File "/home/user/.local/lib/python3.7/site-packages/netmiko/base_connection.py", line 327, in __init__
    self._open()
  File "/home/user/.local/lib/python3.7/site-packages/netmiko/base_connection.py", line 332, in _open
    self.establish_connection()
  File "/home/user/.local/lib/python3.7/site-packages/netmiko/base_connection.py", line 901, in establish_connection
    self.remote_conn_pre.connect(**ssh_connect_params)
  File "/home/user/.local/lib/python3.7/site-packages/paramiko/client.py", line 406, in connect
    t.start_client(timeout=timeout)
  File "/home/user/.local/lib/python3.7/site-packages/paramiko/transport.py", line 660, in start_client
    raise e
  File "/home/user/.local/lib/python3.7/site-packages/paramiko/transport.py", line 2039, in run
    self._check_banner()
  File "/home/user/.local/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)
>>> 

Reference: https://pypi.org/project/netmiko/

What's wrong with this and how to fix it?

2 Replies 2

Derek Zhang
Cisco Employee
Cisco Employee

Try this on the router to see if it works.

 

Router(config)#ip ssh version 2

Manoj Papisetty
Cisco Employee
Cisco Employee
You could be running into
https://bst.cloudapps.cisco.com/bugsearch/bug/CSCsq51052/?reffering_site=dumpcr

The workaround is to configure ssh version 2 on the router -
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip ssh version 2
Router(config)#end