SSH Keys #777
Unanswered
acaplice01
asked this question in
Q&A
SSH Keys
#777
Replies: 1 comment
-
Ended up being this Paramiko/Netmiko issue: Downgrading to Paramiko 2.8.1 fixed the issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I'm trying to get SSH keys working with nornir connections_options. I have a working ssh key connecting to a test swtich I have in my lab. However when I try to connect to the host I am unable to connect and execute the script. It functions normally when using password auth. Config below
groups.yml
IOS:
username: acaplice
password:
platform: ios
port: 22
connection_options:
napalm:
platform: ios
username: acaplice
extras:
optional_args:
key_file: ~/.ssh/id_rsa
use_keys: True
Error:
Traceback (most recent call last):
File "/Users/acaplice/nornir/lib/python3.10/site-packages/napalm/base/base.py", line 86, in _netmiko_open
self._netmiko_device = ConnectHandler(
File "/Users/acaplice/nornir/lib/python3.10/site-packages/netmiko/ssh_dispatcher.py", line 326, in ConnectHandler
return ConnectionClass(*args, **kwargs)
File "/Users/acaplice/nornir/lib/python3.10/site-packages/netmiko/cisco/cisco_ios.py", line 17, in init
return super().init(*args, **kwargs)
File "/Users/acaplice/nornir/lib/python3.10/site-packages/netmiko/base_connection.py", line 350, in init
self._open()
File "/Users/acaplice/nornir/lib/python3.10/site-packages/netmiko/base_connection.py", line 355, in _open
self.establish_connection()
File "/Users/acaplice/nornir/lib/python3.10/site-packages/netmiko/base_connection.py", line 980, in establish_connection
raise NetmikoTimeoutException(msg)
netmiko.ssh_exception.NetmikoTimeoutException: Paramiko: 'No existing session' error: try increasing 'conn_timeout' to 10 seconds or larger.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/acaplice/nornir/lib/python3.10/site-packages/nornir/core/task.py", line 99, in start
r = self.task(self, **self.params)
File "/Users/acaplice/nornir/lib/python3.10/site-packages/nornir_napalm/plugins/tasks/napalm_configure.py", line 29, in napalm_configure
device = task.host.get_connection(CONNECTION_NAME, task.nornir.config)
File "/Users/acaplice/nornir/lib/python3.10/site-packages/nornir/core/inventory.py", line 494, in get_connection
self.open_connection(
File "/Users/acaplice/nornir/lib/python3.10/site-packages/nornir/core/inventory.py", line 546, in open_connection
conn_obj.open(
File "/Users/acaplice/nornir/lib/python3.10/site-packages/nornir_napalm/plugins/connections/init.py", line 57, in open
connection.open()
File "/Users/acaplice/nornir/lib/python3.10/site-packages/napalm/ios/ios.py", line 169, in open
self.device = self._netmiko_open(
File "/Users/acaplice/nornir/lib/python3.10/site-packages/napalm/base/base.py", line 95, in _netmiko_open
raise ConnectionException("Cannot connect to {}".format(self.hostname))
napalm.base.exceptions.ConnectionException: Cannot connect to 10.128.0.11
Beta Was this translation helpful? Give feedback.
All reactions