Huawei switches record device passwords in three ways

If you have forgotten your Telnet login password and cannot log in to the VTY user interface of the device through Telnet, you can log in to the device through the console port and set a new Telnet login password.

# For example, the authentication method of VTY0 login is password verification and the password is YsHsjx_202206, and the configuration is as follows:
<HUAWEI> system-view[HUAWEI] user-interface vty 0 4[HUAWEI-ui-vty0-4] protocol inbound telnet[HUAWEI-ui-vty0-4] authentication-mode password[HUAWEI-ui-vty0-4] set authentication passwordPlease configure the login password (8-16)
Enter Password: //Enter the password YsHsjx_202206
Confirm Password: //Enter the password again YsHsjx_202206 confirm
[HUAWEI-ui-vty0-4] user privilege level 3[HUAWEI] return<HUAWEI> save

# For example, if the authentication mode for logging in to VTY0 is AAA authorization, the username is admin123, and the password is YsHsjx_202206, the configuration is as follows:
<HUAWEI> system-view[HUAWEI] user-interface vty 0 4[HUAWEI-ui-vty0-4] protocol inbound telnet[HUAWEI-ui-vty0-4] authentication-mode aaa[HUAWEI-ui-vty0-4] quit[HUAWEI] aaa[ HUAWEI-aaa] local-user admin123 password irreversible-cipher YsHsjx_202206[HUAWEI-aaa] local-user admin123 service-type telnet[HUAWEI-aaa] local-user admin123 privilege level 3 [ HUAWEI-aaa] return <HUAWEI> save

By default, you only need a password to log in to the device using the Console user interface. To prevent unauthorized users from logging in to the device, we recommend that you use AAA authentication on the console user interface.

What should I do if I forget my password when I log in to the device through the console port?

If you have forgotten the login password of the console port, you can use one of the following methods to configure a new login password for the console port:

The use of Telnet poses security risks, so we recommend that you use STelnet to log in to the device.

The following command line and echo information are used as an example to change the password of the console port of the STelnet login device. After you log in to the device with your STelnet account, perform the following steps:

# For example, if the authentication method of the login user interface is Password authentication and the new password is set to YsHsjx_202206, configure the following parameters:
<HUAWEI> system-view[HUAWEI] user-interface console 0[HUAWEI-ui-console0] authentication-mode password[HUAWEI-ui-console0] set authentication passwordWarning: The "password" authentication mode is not secure, and it is strongly re
commended to use "aaa" authentication mode.
Enter Password(<8-128>):
Confirm password:
[HUAWEI-ui-console0] return <HUAWEI> save

# For example, the authentication mode of the login user interface is AAA authentication, the user name is admin123, and the password is YsHsjx_202206.
<HUAWEI> system-view[HUAWEI] user-interface console 0[HUAWEI-ui-console0] authentication-mode aaa[HUAWEI-ui-console0] quit[HUAWEI] aaa[HUAWEI-aaa] local-user admin123 password irreversible-cipher YsHsjx_202206[HUAWEI-aaa] local-user admin123 privilege level 3[HUAWEI-aaa] local-user admin123 service-type terminal[HUAWEI-aaa] return <HUAWEI> save

What should I do if I forget my password when logging in to my device through STelnet?

If you have forgotten the STelnet login password and cannot log in to the VTY user interface of the device through STelnet, you can log in to the device through the Console port and set a new STelnet login password.

# For example, the authentication method of VTY0 login is password verification and the password is YsHsjx_202206, and the configuration is as follows:
<HUAWEI> system-view[HUAWEI] user-interface vty 0 4[HUAWEI-ui-vty0-4] authentication-mode password[HUAWEI-ui-vty0-4] set authentication passwordPlease configure the login password ( 8-16)
Enter Password: //Enter the password YsHsjx_202206
Confirm Password: //Enter the password again YsHsjx_202206 confirm
[HUAWEI-ui-vty0-4] user privilege level 3[HUAWEI-ui-vty0-4] return<HUAWEI> save

# For example, if the authentication mode for logging in to VTY0 is AAA authorization, the username is admin123, and the password is YsHsjx_202206, the configuration is as follows:
<HUAWEI> system-view[HUAWEI] user-interface vty 0 4[HUAWEI-ui-vty0-4] protocol inbound ssh[HUAWEI-ui-vty0-4] authentication-mode aaa[HUAWEI-ui-vty0-4] quit[HUAWEI] aaa[HUAWEI-aaa] local-user admin123 password irreversible-cipher YsHsjx_202206[HUAWEI-aaa] local-user admin123 service-type ssh[HUAWEI-aaa] local-user admin123 privilege level 3[HUAWEI-aaa] return <HUAWEI> save

By default, you only need a password to log in to the device using the Console user interface. To prevent unauthorized users from logging in to the device, we recommend that you use AAA authentication on the console user interface.