Troubleshooting Junos PyEZ Authentication Errors When Managing Devices Running Junos OS

 

Problem

Description:

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

or

Cause

The device running Junos OS 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 device running Junos OS or on the console server through which it connects.

  • The user has an account with a text-based password configured on the device running Junos OS 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 device running Junos OS 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 devices running Junos OS 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.