华为交换机登录设备时忘记密码的三种处理方式

通过Telnet登录设备时忘记密码如何处理

如果忘记了Telnet登录密码,无法通过Telnet登录设备的VTY用户界面,用户可以通过Console口登录设备后设置新的Telnet登录密码。

# 以登录VTY0的验证方式为密码验证,密码为YsHsjx_202206为例,配置如下。
<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:   //输入密码YsHsjx_202206
Confirm Password:   //再次输入密码YsHsjx_202206进行确认
[HUAWEI-ui-vty0-4] user privilege level 3[HUAWEI] return<HUAWEI> save

# 以登录VTY0的验证方式为AAA授权验证,用户名为admin123,密码为YsHsjx_202206为例,配置如下。
<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

缺省情况下,使用Console用户界面登录设备时只需要密码认证。为了防止非法用户登录设备,建议使用Console用户界面的认证方式为AAA认证。

通过Console口登录设备时忘记密码如何处理

如果忘记了Console口登录密码,用户可以通过以下两种方式来配置新的Console口登录密码。

使用Telnet协议存在安全风险,建议用户使用STelnet登录设备。

以下涉及的命令行及回显信息以STelnet登录设备修改Console口密码为例。用户通过STelnet帐号登录设备后,请按照如下步骤进行配置。

# 以登录用户界面的认证方式为Password认证,设置的新密码为YsHsjx_202206为例,配置如下。
<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

# 以登录用户界面的认证方式为AAA认证,用户名为admin123,密码为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

通过STelnet登录设备时忘记密码如何处理

如果忘记了STelnet登录密码,无法通过STelnet登录设备的VTY用户界面,用户可以通过Console口登录设备后设置新的STelnet登录密码。

# 以登录VTY0的验证方式为密码验证,密码为YsHsjx_202206为例,配置如下。
<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:   //输入密码YsHsjx_202206
Confirm Password:   //再次输入密码YsHsjx_202206进行确认
[HUAWEI-ui-vty0-4] user privilege level 3[HUAWEI-ui-vty0-4] return<HUAWEI> save

# 以登录VTY0的验证方式为AAA授权验证,用户名为admin123,密码为YsHsjx_202206为例,配置如下。
<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

缺省情况下,使用Console用户界面登录设备时只需要密码认证。为了防止非法用户登录设备,建议使用Console用户界面的认证方式为AAA认证。