Reputation: 11
I haven't updated anything recently that I can think of that would have impacted nacl and the signing process for paramiko, but now it will not work. I have reinstalled paramiko, and netmiko and made sure all of the crypto libraries are up to date. I am at a loss what else to do, any thoughts?
from netmiko import ConnectHandler
...
def main(device_list):
username = input("\nWhat is your username? -> ")
password = getpass.getpass("\nWhat is your password? -> ")
for host in device_list:
juniper_device = {
'device_type': 'juniper',
'ip': host,
'username': username,
'password': password,
'verbose': False
}
Netmiko uses the Paramiko library to make SSH connections. This bit of code is what sets up the device definition.
Here is the stack trace associated with the creation of the device and the opening of an ssh connection.
Traceback (most recent call last):
File "./get_running-config.py", line 5, in <module>
from netmiko import ConnectHandler
File "/usr/local/lib/python3.4/dist-packages/netmiko/__init__.py", line 8, in <module>
from netmiko.ssh_dispatcher import ConnectHandler
File "/usr/local/lib/python3.4/dist-packages/netmiko/ssh_dispatcher.py", line 4, in <module>
from netmiko.a10 import A10SSH
File "/usr/local/lib/python3.4/dist-packages/netmiko/a10/__init__.py", line 2, in <module>
from netmiko.a10.a10_ssh import A10SSH
File "/usr/local/lib/python3.4/dist-packages/netmiko/a10/a10_ssh.py", line 4, in <module>
from netmiko.cisco_base_connection import CiscoSSHConnection
File "/usr/local/lib/python3.4/dist-packages/netmiko/cisco_base_connection.py", line 3, in <module>
from netmiko.base_connection import BaseConnection
File "/usr/local/lib/python3.4/dist-packages/netmiko/base_connection.py", line 13, in <module>
import paramiko
File "/usr/local/lib/python3.4/dist-packages/paramiko/__init__.py", line 22, in <module>
from paramiko.transport import SecurityOptions, Transport
File "/usr/local/lib/python3.4/dist-packages/paramiko/transport.py", line 57, in <module>
from paramiko.ed25519key import Ed25519Key
File "/usr/local/lib/python3.4/dist-packages/paramiko/ed25519key.py", line 22, in <module>
import nacl.signing
File "/usr/local/lib/python3.4/dist-packages/nacl/signing.py", line 19, in <module>
import nacl.bindings
File "/usr/local/lib/python3.4/dist-packages/nacl/bindings/__init__.py", line 17, in <module>
from nacl.bindings.crypto_box import (
File "/usr/local/lib/python3.4/dist-packages/nacl/bindings/crypto_box.py", line 27, in <module>
crypto_box_SEEDBYTES = lib.crypto_box_seedbytes()
AttributeError: cffi library '_sodium' has no function, constant or global variable named 'crypto_box_seedbytes'
Upvotes: 0
Views: 966
Reputation: 11
After a lot of tinkering with the cryptography and subsequent modules, I just fresh installed all related libraries and things work now. Not really sure how it got in this state unfortunately but it was easier to just start over.
Upvotes: 1
Reputation: 38187
Unless you post the code, some guessing is needed:
Maybe the problem is similar to https://github.com/mitmproxy/mitmproxy/issues/2372, where it was solved by installing the cryptography
package in version 1.9.
Upvotes: 0