QuestionQ12

VerifiedPython/PyEZ

You need to secure device credentials and hide the user's password input while running scripts.

Which Python module would you import for this purpose?

Explanation

The getpass module in Python is specifically designed to prompt a user for input, such as a password, without echoing it on the console, which helps secure credentials when they are entered interactively during script execution. This is commonly used in Junos PyEZ automation scripts to avoid hardcoding or displaying device passwords in plaintext. The other modules serve different purposes: junos-eznc (PyEZ) is the automation framework for interacting with Junos devices, ncclient is a NETCONF client library, and paramiko is an SSH protocol library — none of them handle secure, hidden password entry.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!