Courseiva
easyMultiple Choice

CCNP Practice Question: Uses the following Python script with Netmiko to…

A network engineer uses the following Python script with Netmiko to send a command to a Cisco IOS-XE device:

```python

from netmiko import ConnectHandler

device = { 'device_type': 'cisco_ios', 'ip': '10.1.1.1', 'username': 'admin', 'password': 'password', 'secret': 'enable_secret'

}

connection = ConnectHandler(**device) output = connection.send_command('show ip interface brief')

print(output)

connection.disconnect() ```

What is the purpose of the 'secret' parameter in the device dictionary?

⚠ Common exam trap

350-401 often tests the distinction between authentication parameters (username/password), privilege escalation (secret/enable), and transport security (SSH keys), causing candidates to confuse 'secret' with SSH key authentication or session encryption.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

It is used to enter enable mode after connecting to the device.

In Netmiko, the 'secret' parameter in the device dictionary is the enable password used to enter privileged EXEC (enable) mode after the initial SSH connection is established. When Netmiko connects, it authenticates with the username/password, and if 'secret' is provided, it can send the enable command to elevate privileges. This is required for commands that need privileged access, such as 'show running-config' on some platforms.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    It is used for SSH key-based authentication.

    Why it's wrong here

    SSH key-based authentication uses the 'use_keys' and 'key_file' parameters, not 'secret'. The 'secret' parameter holds the privileged EXEC (enable) password, letting Netmiko enter enable mode; it is the right choice when a script must run commands requiring elevated privilege after login.

  • ✓

    It is used to enter enable mode after connecting to the device.

    Why this is correct

    Netmiko's 'secret' supplies the enable password, which the library sends after login to escalate from user EXEC to privileged EXEC mode. Without it, commands such as 'show ip interface brief' that require elevated privileges would be rejected by the IOS-XE device.

  • ✗

    It is used to encrypt the session.

    Why it's wrong here

    Session encryption is negotiated by the SSH transport itself, not by any Netmiko dictionary key. The 'secret' parameter carries the enable password used to enter privileged EXEC mode; it is the correct field whenever a script must elevate privileges before running commands such as show running-config.

  • ✗

    It is used to set the SNMP community string.

    Why it's wrong here

    SNMP community strings are configured on the device itself, not passed through Netmiko's connection dictionary. The 'secret' parameter supplies the privileged EXEC (enable) password so send_command can run commands requiring elevated mode; it would be the right field when a script must enter enable mode before issuing show running-config.

About these practice questions

This 350-401 question is part of Courseiva's 1,923-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.