Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting wrong username/password error while connecting through serial mode #1229

Open
Aaron-MJohn opened this issue Feb 2, 2023 · 4 comments

Comments

@Aaron-MJohn
Copy link

Aaron-MJohn commented Feb 2, 2023

I am able to connect to a switch with no password through serial mode without any error. But after setting password to the switch when I try to connect through serial mode I have seen the code fail randomly. Some times I am able to connect but most of the time I get ConnectAuthError(host: None, msg: Bad username/password).

When I looked at the code I see the serial read output shows the password was provided for the login prompt after 1st password fail.


2023-02-02 14:40:15,136 - [tty.py:107] - [INFO]: TTY: connecting to TTY:COM3 ..."
2023-02-02 14:40:15,139 - [tty.py:110] - [INFO]: TTY: logging in......"
2023-02-02 14:40:15,255 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:15,364 - [tty_serial.py:86] - [INFO]: output: b'\r\n'"
2023-02-02 14:40:15,474 - [tty_serial.py:86] - [INFO]: output: b'\r\n'"
2023-02-02 14:40:15,583 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:15,692 - [tty_serial.py:86] - [INFO]: output: b'FreeBSD/arm (sw0) (ttyu0)\r\r\n'"
2023-02-02 14:40:15,803 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:15,904 - [tty_serial.py:86] - [INFO]: output: b'log \r\n'"
2023-02-02 14:40:16,014 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:16,123 - [tty_serial.py:86] - [INFO]: output: b'FreeBSD/arm (sw0) (ttyu0)\r\r\n'"
2023-02-02 14:40:16,232 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:16,343 - [tty_serial.py:86] - [INFO]: output: b'login: \r\r\r\n'"
2023-02-02 14:40:16,452 - [tty_serial.py:86] - [INFO]: output: b'FreeBSD/arm (yu0)\r\r\n'"
2023-02-02 14:40:16,561 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:16,671 - [tty_serial.py:86] - [INFO]: output: b'login: \r\n'"
2023-02-02 14:40:16,780 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:16,890 - [tty_serial.py:86] - [INFO]: output: b'FreeBSD/arm (sw0) (ttyu0)\r\r\n'"
2023-02-02 14:40:17,005 - [tty_serial.py:86] - [INFO]: output: b'\r\r\n'"
2023-02-02 14:40:17,114 - [tty_serial.py:86] - [INFO]: output: b'login: root\r\n'"
2023-02-02 14:40:17,223 - [tty_serial.py:86] - [INFO]: output: b'Password:\r\n'"
2023-02-02 14:40:17,326 - [tty_serial.py:86] - [INFO]: output: b'Login incorrect\r\n'"
2023-02-02 14:40:17,444 - [tty_serial.py:86] - [INFO]: output: b'login: password_string\r\n'"
2023-02-02 14:40:17,546 - [tty_serial.py:86] - [INFO]: output: b'Password:\r\n'"
2023-02-02 14:40:17,660 - [tty_serial.py:86] - [INFO]: output: b'\r\n'"
2023-02-02 14:40:17,771 - [tty_serial.py:86] - [INFO]: output: b'password_string\r\n'"
2023-02-02 14:40:17,879 - [tty_serial.py:86] - [INFO]: output: b'Login incorrect\r\n'"
2023-02-02 14:40:17,879 - [console.py:215] - [ERROR]: Exception occurred: login:ConnectAuthError(host: None, msg: Bad username/password)
"
2023-02-02 14:40:17,880 - - [ERROR]: Failed to Authenticate username and password: ConnectAuthError(host: None, msg: Bad username/password)"
2023-02-02 14:40:17,880 - - [ERROR]: Wrong username or password"

output is from this

line = self._ser.readline()

@Aaron-MJohn
Copy link
Author

I tried to increase the sleep time before reading the output. But still having issue.

@Aaron-MJohn
Copy link
Author

I see after first bad password, the code enter's password for login instead of username. Which cause login incorrect error.

@ydnath
Copy link
Member

ydnath commented Feb 3, 2023

Which box is this tried on? What is the Junos s/w version?

@Aaron-MJohn
Copy link
Author

This is from EX-2300-C JUNOS 20.4R3-S3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants