An engineer often remotely logs in to the device to check the device status. The engineer can use the Python Paramiko and telnetlib libraries to implement automatic remote login through Python scripts.
The remote login implemented using telnetlib is more secure.
Correct Answer: B
Comparison Between Paramiko (SSH) and Telnetlib (Telnet)
# Paramiko (SSH) is more secure than Telnetlib (Telnet).
* SSH (Secure Shell) encrypts login credentials and session data using encryption protocols like AES and RSA.
* Telnet transmits data in plaintext, making it vulnerable to eavesdropping and man-in-the-middle attacks.
# Why is Telnet Insecure?
* No encryption # Credentials (username/password) are sent in plaintext.
* Easily intercepted by attackers using packet sniffers (e.g., Wireshark).
Correct Method for Secure Remote Login in Python:
* Use Paramiko for SSH-based secure automation.
* Example of logging in with Paramiko (SSH) in Python:
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("192.168.1.1", username="admin", password="password")
stdin, stdout, stderr = ssh.exec_command("display version")
print(stdout.read().decode())
ssh.close()
Reference from Huawei HCIE-Datacom Documentation:
* Huawei Security Best Practices - Avoiding Telnet and Using SSH for Secure Access
* HCIE-Datacom Training Material - Network Automation with Python (Paramiko & Telnetlib)