ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.63k stars 1.31k forks source link

HP Procurve Telnet: Incorrect username pattern #2528

Closed BravoBravissimo closed 3 years ago

BravoBravissimo commented 3 years ago

I was confused as to why netmiko raised an authentication exception when attempting to connect via telnet to a Aruba 2530 switch, when I was passing the exact same credentials for connecting to it via SSH successfully.

Investigating the stack trace revealed that the username_pattern in HPProcurveTelnet is incorrectly set to look for "Login name:", when the actual prompt is "Username:: https://github.com/ktbyers/netmiko/blob/a83ce2e4d5bd92dc06a8ad11e1c0bf9c374e074b/netmiko/hp/hp_procurve.py#L172-L181

I am a unsure if there are ProCurve switches which do indeed prompt with "Login name:" instead, but none of the ProCurve switches, old and new, in my environment prompt do.

In any case, the telnet connection is working wonderfully after amending the pattern locally.

Edit1: Just to clarify, the pattern can probably just be modified to include "Username" so that both cases are accounted for.

ktbyers commented 3 years ago

Fixed here:

https://github.com/ktbyers/netmiko/pull/2529