日常华为网络设备运维中,我们常常需要密码进入设备调试,一旦不知道密码我们该如何重置密码,以下是具体方法:
一、重置Console口密码
通过Console口登录设备,是最常用的一种方式。通常情况下,使用Console配置登录密码,只有密码输入正确,才能登录进设备进行配置和管理。那如果忘记了Console的登录密码,该怎么处理呢?现在介绍以下两种方法:
1、通过telnet或者ssh远程登录到设备,进行恢复操作
#远程账户必须是管理员权限
<HUAWEI> system-view[HUAWEI] user-interface console 0[HUAWEI-ui-console0] authentication-mode password[HUAWEI-ui-console0] set authentication password cipher password(需要修改的密码)[HUAWEI-ui-console0] return<HUAWEI>save
如果登录时认证方式是AAA认证,则操作步骤如下:
<HUAWEI> system-view[HUAWEI] user-interface console 0[HUAWEI-ui-consoleO] authentication-mode aaa[HUAWEI-ui-consoleO] quit[HUAWEI] aaa[HUAWEl-aaa] local-user admin password irreversible-cipher password(需要修改的密码)[HUAWEI-aaa] local-user admin service-type terminal[HUAWEI-aaa] return<HUAWEI> save
2、BootRom菜单清除Console登录密码
#这种会导致设备重启,所以时间要自己衡量
(1)首先用console线连接交换机和主机,打开SecureCRT终端软件,然后重启交换机,这时终端上会交换机开机加载界面,当出现“Press Ctrl+B to enter Boot Menu...”时,按下组合键“Ctrl+B”并输入BootROM密码(缺省为“Admin@huawei.com”),进入BootROM主菜单。
BootROM MENU1. Boot with default mode2. Enter serial submenu3. Enter startup submenu4. Enter ethernet submenu5. Enter filesystem submenu6. Modify BootROM password7. Clear password for console user8. Reboot(Press Ctrl+E to enter diag menu)Enter your choice(1-8): 7Note: Clear password for console user? Yes or No(Y/N): yClear password for console user successfully. Choose "1" to boot, then set a newpassword.Note: Do not choose "8. Reboot" or power off the device, otherwise this operationwill not take effect.
(2)在BootROM主菜单下选择第7项“Clear password for console user”清除Console口登录密码。
(3)根据交换机的提示,在BootROM主菜单下选择“Boot with default mode”启动设备。 注:不要选择第8项"Reboot",否则此次清除密码将失效。
(4)完成系统启动后,根据设备不同可能会提示首次登录是否需要配置密码,有的设备登录需要密码的话为设备初始密码;
如果有的设备登录时不需要密码,需要登录后配置Console口密码,可自行配置具体如下:
<HUAWEI> system-view[HUAWEI] user-interface console 0[HUAWEI-ui-console0] authentication-mode password[HUAWEI-ui-console0] set authentication password cipher password(需要修改的密码)[HUAWEI-ui-console0] return
2.恢复Telnet登录密码
telnet登录密码丢失,可以通过其他方式(例如Console口)登录交换机后重新进行配置。
步骤1:通过其他方式(例如Console)登录交换机。
步骤2:修改用户密码。
以针对VTY0~4配置AAA验证方式,原用户名为“huawei”,密码配置为“H*****@***”为例。
<HUAWEI> system-view[HUAWEI] user-interface vty 0 4[HUAWEI-ui-vty0-4] authentication-mode aaa[HUAWEI-ui-vty0-4] quit[HUAWEI] aaa[HUAWEI-aaa] local-user huawei password irreversible-cipher H*****@***[HUAWEI-aaa] local-user huawei service-type telnet[HUAWEI-aaa] local-user huawei privilege level 3
三、重置Web登录密码
如果设备Web登录密码忘记,可以通过telnet、shh、Console口等登录交换机后重新进行配置。
以使用AAA认证方式,用户名为“huawei”,修改后的密码为“H*****@***”为例。
<HUAWEI> system-view[] aaa[] local-user huawei password irreversible-cipher H*****@***[] local-user huawei service-type http[] local-user huawei privilege level 3<HUAWEI> save
四、重置BootROM登录密码
通过Console口登录交换机重置BootROM密码。
(1)在任意视图下使用命令reset boot password恢复BootROM密码为缺省密码(缺省为A****@******)。
(2)在用户视图下使用命令reboot重启交换机。
(3)当重启过程中出现“Press Ctrl+B to enter Boot Menu...”打印信息时,按组合键“Ctrl+B”,输入缺省密码后进入BootROM主菜单。
(4)在BootROM主菜单下选择“Modify BootROM password”并按照提示修改密码。