Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos PyEZ Developer Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Troubleshoot Junos PyEZ Authentication Errors When Managing Junos Devices

date_range 18-Aug-22

Problem

Description

Junos PyEZ generates an error regarding failed authentication. For example:

content_copy zoom_out_map
unable to connect to dc1a.example.com: ConnectAuthError(dc1a.example.com)

or

content_copy zoom_out_map
jnpr.junos.tty_ssh:SSH Auth Error

Cause

The Junos device or the console server through which the application connects might fail to authenticate the user for the following reasons:

  • The user does not have an account on the Junos device or on the console server through which the application connects.

  • The user has an account with a text-based password configured on the Junos device and the console server, if one is used, but the wrong password or no password is supplied for the user when creating the Device instance.

  • The user has an account and authenticates using SSH keys with the Junos device or a console server connected to the device, but the SSH keys are inaccessible on either the device or the configuration management server.

Note:

If you do not specify a user when creating the Device instance, the user defaults to $USER.

Solution

Ensure that the user executing the Junos PyEZ code has a login account on all target Junos devices or console servers where appropriate and that the SSH public key or text-based password is configured for the account. If SSH keys are configured, verify that the user can access them. Also, confirm that the correct parameters are supplied when creating the Device instance.

footer-navigation