华为园区框式交换机恢复Console口密码的方法

交换机有三种方法恢复Console口密码。

方法一:通过STelnet/Telnet登录设备修改Console口密码。
方法二:在BootROM下配置清除Console口密码启动后,修改Console口密码。
方法三:在BootROM菜单下取消设置下次启动配置文件,设备以空配置启动后修改Console口密码。

请优先使用方法一,如果STelnet/Telnet密码也忘记了再使用其它两个方法。使用Telnet协议存在安全风险,建议用户使用STelnet V2登录设备。
如果Console登录用的是密码认证,在方法一不可用的情况下优先使用方法二。
如果Console登录用的是AAA认证,使用方法三。
以下设备回显仅作举例,不同版本,回显可能会稍有不同,请以设备的实际显示为准。
通过STelnet/Telnet登录设备修改Console口密码
以下涉及的命令行及回显信息以STelnet登录设备修改Console口密码为例。

如果用户拥有STelnet账号,并且具有3级或更高的权限,则可以通过STelnet登录到设备后修改Console口密码,然后保存配置。

使用STelnet账号登录设备,并确认当前账号有3级或更高的权限。
使用display users命令查看当前设备所有登录用户。其中带“+”标记行为当前用户,记录对应的编号VTY1。

<HUAWEI> display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
129 VTY 0 00:23:36 TEL 10.135.18.67 pass no Username : Unspecified

+ 130 VTY 1 01:20:36 TEL 10.135.18.91 pass no Username : Unspecified

131 VTY 2 00:00:00 TEL 10.135.18.54 pass no Username : Unspecified
使用display user-interface命令可以显示所有用户的权限,确定VTY1对应的等级为15,有权限修改Console口密码。

<HUAWEI> display user-interface
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
0 CON 0 9600 – 15 – P –
+ 129 VTY 0 – 15 15 P –
+ 130 VTY 1 – 15 15 P –
+ 131 VTY 2 – 15 – P –
132 VTY 3 – 15 15 P –
修改Console用户的密码,以修改为密码认证,密码为“huawei@123”为例。
<HUAWEI> system-view
[HUAWEI] user-interface console 0
[HUAWEI-ui-console0] authentication-mode password
[HUAWEI-ui-console0] set authentication password cipher huawei@123
[HUAWEI-ui-console0] return
为了防止重启后配置丢失,保存配置。
<HUAWEI> save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 4.
Save the configuration successfully.
在BootROM下清除Console口密码登录后,修改Console口密码
设备的BootROM提供了清除Console口密码的功能,可以在用户使用Console口登录的时候跳过密码检查。这样系统启动后除了不需要输入Console密码外,与正常启动相同,也会完成所有配置加载。设备启动后修改Console口密码,然后保存配置。

要进入到BootROM菜单需要重启设备,会导致业务中断,请视具体情况做好备份,并尽量选择业务量较少的时间操作。
清除Console口密码登录后请马上配置新的密码。
在此操作过程中不要对设备进行下电。
如果交换机是双主控环境,需要在重启交换机之前将备主控板拔下,重启后再将备主控板插上。
用串口线连接设备,然后重启。当出现“Press Ctrl+B to enter Boot Menu :”打印信息时,按下“Ctrl+B”并键入密码,进入BootROM主菜单。
您可以在《S系列交换机缺省帐号与密码》(企业网、运营商)文档中获取各种缺省帐号与密码信息。获取该文档需要权限,如需升级权限,请查看网站帮助。

清除Console口登录密码。
MAIN MENU

1. Boot with default mode
2. Boot from Flash
3. Boot from CFCard
4. Enter serial submenu
5. Enter ethernet submenu
6. Enter file system submenu
7. Enter test submenu
8. Modify BootROM password //V200R006及之前版本:Modify BootROM password,V200R007及之后版本:Enter password submenu
9. Modify Flash description area
10. Clear password for console user
11. Reboot

Enter your choice(1-11): 10 // 用户输入10,即清除密码

Note: Clear password for console user? Yes or No(Y/N): y

Clear password for console user successfully.
Note: Choose “1. Boot with default mode” to boot, then set a new password
根据设备的提示,在BootROM主菜单下选择“1”启动设备。
完成系统启动后,通过Console口登录时不需要认证,登录后配置Console口密码,以修改为密码认证,并修改密码为“huawei@123”为例。
<HUAWEI> system-view
[HUAWEI] user-interface console 0
[HUAWEI-ui-console0] authentication-mode password
[HUAWEI-ui-console0] set authentication password cipher huawei@123
[HUAWEI-ui-console0] return
为了防止重启后配置丢失,保存配置。
<HUAWEI> save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 4.
Save the configuration successfully.
在BootROM菜单下取消设置下次启动配置文件,设备以空配置启动后修改Console口密码
在BootROM下取消设置下次启动配置文件,设备会以空配置(出厂配置)启动。启动后将原配置文件导出,手动修改其中关于Console口登录的配置。将修改后的配置文件重新上传至设备,配置设备以修改后的配置文件启动,重启后的设备将无需输入Console口登录密码。

要进入到BootROM菜单需要重启设备,会导致业务中断,请视具体情况做好备份,并尽量选择业务量较少的时间操作。
在此操作过程中不要对设备进行下电。
此方法仅适用于V200R003及其以后版本,V200R003以前版本不支持。
用串口线连接设备,然后重启,当出现“Press Ctrl+B to enter Boot Menu :”打印信息时,按下“Ctrl+B”并键入密码后进入BootROM主菜单。
您可以在《S系列交换机缺省帐号与密码》(企业网、运营商)文档中获取各种缺省帐号与密码信息。获取该文档需要权限,如需升级权限,请查看网站帮助。

清空启动配置文件,使设备以空配置启动。

注意记录设备当前配置文件名,以便后续恢复原配置。

MAIN MENU

1. Boot with default mode
2. Boot from Flash
3. Boot from CFCard
4. Enter serial submenu
5. Enter ethernet submenu
6. Enter file system submenu
7. Enter test submenu
8. Modify BootROM password //V200R006及之前版本:Modify BootROM password,V200R007及之后版本:Enter password submenu
9. Modify Flash description area
10. Clear password for console user
11. Reboot

Enter your choice(1-11): 9
Modify flash description area
Please select booting device
Press ENTER directly for no change or input your choice
1: Flash, 2: CFcard
Current booting device: 2, your choice: //采用当前值,无需设置,直接回车
Current booting file name: cfcard:/HUAWEIV200R003C00.CC,
Press ENTER directly for no change
Or, please input the file name (e.g. quidway.cc): //采用当前值,无需设置,直接回车

Initiate Flash VFS…OK!
Getting Device Index named “flash:”…OK!

Saved-configuration file
‘.’=clear field; ‘^D’=quit; Enter=use current configuration
new=change to other configuration file
current: vrpcfg.zip
new : . //清空当前值
Saved-patch file
‘.’=clear field; ‘^D’=quit; Enter=use current patch
new=change to other patch file
current:
new : //不升级补丁文件,无需设置,直接回车
在BootROM主菜单下选择“1”启动设备。
完成系统启动后,设备会恢复为出厂配置。通过Console口登录时,提示设置Console口密码,以密码为“huawei@123”为例。
An initial password is required for the first login via the console.
Continue to set it? [Y/N]:y
Set a password and keep it safe. Otherwise you will not be able to login via the console.

Please configure the login password (8-16)
Enter Password: //输入huawei@123
Confirm Password: //再次输入huawei@123
恢复原配置。当前设备为默认的出厂配置,若希望恢复设备原配置,又不想保留原配置文件中关于Console密码的配置,可以下载原配置文件到PC上,手动删除Console下配置后,上传至设备,指定为下次启动文件,重启设备。
配置设备为FTP服务器。
<HUAWEI> system-view
[HUAWEI] ftp server enable
Info: The FTP server is already enabled.
[HUAWEI] interface ethernet 0/0/0
[HUAWEI-Ethernet0/0/0] ip address 10.110.24.254 24
[HUAWEI-Ethernet0/0/0] quit
[HUAWEI] aaa
[HUAWEI-aaa] local-user huawei password irreversible-cipher huawei@123
[HUAWEI-aaa] local-user huawei ftp-directory cfcard:
[HUAWEI-aaa] local-user huawei service-type ftp
[HUAWEI-aaa] local-user huawei privilege level 15
下载原配置文件vrpcfg.zip到PC。
C:\Documents and Setting\Administrator> ftp 10.110.24.254
连接到 10.110.24.254。
220 FTP service ready.
用户 (10.110.24.254:(none)): huawei
331 Password required for huawei.
密码:
230 User logged in.
ftp> get vrpcfg.zip
200 Port command okay.
150 Opening ASCII mode data connection for directory list.
226 Transfer complete.
ftp: 收到 981 字节,用时 0.01秒 981000.00千字节/秒.
在PC上解压后使用文本编辑工具(建议用系统自带的文本编辑工具)打开并删除Console口认证配置,删除后重新压缩成vrpcfg.zip文件。需删除的配置如下所示:
#
user-interface maximum-vty 15
user-interface con 0
authentication-mode password //需手动删除
set authentication password cipher %@%@:*IB+w7j~””GlU$0-;\#m@Jw%@%@ //需手动删除
#
user-interface con 0
authentication-mode aaa //需手动删除
user privilege level 15 //需手动删除
将修改后的配置文件保存后,上传到设备,替换原配置文件。
ftp> put vrpcfg.zip
200 Port command okay.
150 Opening ASCII mode data connection for directory list.
226 Transfer complete.
ftp: 发送 981 字节,用时 0.00Seconds 978000.00千字节/秒.
设置修改后的配置文件为下一次启动配置文件,选择不保存配置重启设备。
<HUAWEI> startup saved-configuration vrpcfg.zip
Info: Succeeded in setting the configuration for booting system.
<HUAWEI> reboot fast
System will reboot! Continue ? [y/n]:y
重启后,会再次提醒设置Console登录密码,输入一个安全并方便自己记忆的密码后,回车,进入命令行界面。

ICP备案号:晋ICP备18007549号-1
站长微信:13613567205