This one has me scratching my head....
Trying to connect to an EX-3400 using PyEz. I've done 'set system services netconf ssh'. I can connect fine using ncclient but PyEz gives me "ConnectAuthError". Here's my code:
import sys
from getpass import getpass
from jnpr.junos import Device
from jnpr.junos.exception import ConnectError
hostname = input("Device hostname: ")
junos_username = input("Junos OS username: ")
junos_password = getpass("Junos OS or SSH key password: ")
dev = Device(host=hostname, user=junos_username, passwd=junos_password)
try:
dev.open()
except ConnectError as err:
print ("Cannot connect to device: {0}".format(err))
sys.exit(1)
except Exception as err:
print (err)
sys.exit(1)
print (dev.facts)
dev.close()
I don't understand how ncclient works but not PyEz since they both use netconf. I've tried using the root user as well as a 'pyez' user that has read-only rights. Any help would be greatly appreciated.