Unifi switch returns "failed to enter enable mode" upon connect
See original GitHub issueWhen trying out the UbiquitiUnifiSwitchSSH
class, I keep running in “failed to enter enable mode”.
I used a debugger to see where it goes wrong.
It successfully sends out the command here:
https://github.com/ktbyers/netmiko/blob/d0dc0c0dc8d2a52c0c5b92d60cd1427e71878d4c/netmiko/base_connection.py#L1677
Then with this line:
https://github.com/ktbyers/netmiko/blob/d0dc0c0dc8d2a52c0c5b92d60cd1427e71878d4c/netmiko/base_connection.py#L1679
The output becomes enable\r\n\r\n(UBNT) #
That is the correct response, the session is in “enable” now. Nothing more is needed. It however does not see the pattern ssword
in the output, so here:
https://github.com/ktbyers/netmiko/blob/d0dc0c0dc8d2a52c0c5b92d60cd1427e71878d4c/netmiko/base_connection.py#L1681-L1683
It’s going to read until prompt or pattern. This function times out because no more output is coming.
I can see, at the time this code was merged, the function looked differently:
I suppose that code will work, given that it will only do one read.
I think the existing logic does not work with Unifi Switch because no password should be entered. I’m willing to push some code, but would need some guidance then what would be an appropriate solution.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top GitHub Comments
Should be fixed here:
https://github.com/ktbyers/netmiko/pull/2220
It is standard behavior not to prompt, I didn’t set any config for that. I don’t know if and how a password/secret could be set and what it’s behavior would be.