Huawei(华为)

一、设备登陆缺省密码


1.1 S系列交换机缺省帐号与密码

S系列交换机缺省帐号与密码.pdf

二、恢复Console口登录密码


:::warning 如果忘记了Console口登录密码或者希望修改Console口登录密码,用户可以通过以下两种方式来设置新的Console口登录密码。 :::

2.1 通过STelnet/Telnet登录交换机设置新的Console口登录密码

:::success 医疗_消息.png 说明
使用Telnet协议存在安全风险,建议用户使用STelnet V2登录设备。 ::: 这种方法的前提是:用户拥有STelnet/Telnet账号并且具有管理员的权限。以下涉及的命令行及回显信息以STelnet登录设备修改Console口密码为例。用户通过STelnet账号登录交换机后,请按照如下步骤进行配置。

  1. # 以登录用户界面的认证方式为密码认证,密码为Example@123为例,配置如下。
  2. <HUAWEI> system-view
  3. [HUAWEI] user-interface console 0
  4. [HUAWEI-ui-console0] authentication-mode password
  5. [HUAWEI-ui-console0] set authentication password cipher Example@123
  6. [HUAWEI-ui-console0] return
  7. <HUAWEI> save
  1. # 以登录用户界面的认证方式为AAA认证,用户名为admin123,密码为Example@123为例,配置如下。
  2. <HUAWEI> system-view
  3. [HUAWEI] user-interface console 0
  4. [HUAWEI-ui-console0] authentication-mode aaa
  5. [HUAWEI-ui-console0] quit
  6. [HUAWEI] aaa
  7. [HUAWEI-aaa] local-user admin123 password irreversible-cipher Example@123
  8. [HUAWEI-aaa] local-user admin123 service-type terminal
  9. [HUAWEI-aaa] return
  10. <HUAWEI> save

2.2 通过BootLoad清除Console口登录密码

:::success 医疗_消息.png 说明
如果交换机是双主控,则需要在执行以下操作前将备用主控板拔下,待执行完以下操作后,再插上备用主控板,执行save命令以保证主用主控板和备用主控板配置一致。 ::: 交换机的BootLoad提供了清除Console口登录密码的功能,用户可以在交换机启动后修改Console口登录密码,然后保存配置。请按照如下步骤进行配置。

  1. 通过Console口连接交换机,并重启交换机。
    1. 当界面出现以下打印信息时,及时按下快捷键“Ctrl+B”或者“Ctrl+E”并输入BootLoad密码,进入BootLoad主菜单。

      Press Ctrl+B or Ctrl+E to enter BootLoad menu … 2 password: //输入BootLoad密码

:::success 医疗_消息.png 说明
不同版本和不同形态的设备回显有差异,请以实际设备显示为准。 :::

  1. 在BootLoad主菜单下选择“Clear password for console user”清除Console口登录密码。
  2. 根据交换机的提示,在BootLoad主菜单下选择“Boot with default mode”启动设备。 :::success 医疗_消息.png 说明
    请注意,此处不要选择“Reboot”选项,否则此次清除密码将失效。 :::

  3. 完成系统启动后,通过Console口登录时不需要认证,登录后按照系统提示配置验证密码。(V200R009及之后版本,完成系统启动后,通过Console口登录时认证方式为None,系统启动后不会提示配置验证密码。)

  4. 登录交换机后,用户可以根据需要配置Console用户界面的认证方式及密码。

2.3 视频教学

如何恢复Console密码.mp4 (22.28MB)

三、恢复Telnet密码


如果忘记了Telnet登录密码或者希望修改Telnet登录密码,用户可以通过Console口登录交换机后设置新的Telnet登录密码。

  1. # 以登录VTY0的验证方式为密码验证,密码为Example@123为例,配置如下。
  2. <HUAWEI> system-view
  3. [HUAWEI] user-interface vty 0
  4. [HUAWEI-ui-vty0] protocol inbound telnet //V200R006及之前版本缺省使用的协议为Telnet协议,可以不配置该项;V200R007及之后版本缺省使用的协议为SSH协议,必须配置。
  5. [HUAWEI-ui-vty0] authentication-mode password
  6. [HUAWEI-ui-vty0] set authentication password cipher Example@123
  7. [HUAWEI-ui-vty0] user privilege level 15
  8. [HUAWEI-ui-vty0] return
  9. <HUAWEI> save
  1. # 以登录VTY0的验证方式为AAA授权验证,用户名为admin123,密码为Example@123为例,配置如下。
  2. <HUAWEI> system-view
  3. [HUAWEI] user-interface vty 0
  4. [HUAWEI-ui-vty0] protocol inbound telnet //V200R006及之前版本缺省使用的协议为Telnet协议,可以不配置该项;V200R007及之后版本缺省使用的协议为SSH协议,必须配置。
  5. [HUAWEI-ui-vty0] authentication-mode aaa
  6. [HUAWEI-ui-vty0] quit
  7. [HUAWEI] aaa
  8. [HUAWEI-aaa] local-user admin123 password irreversible-cipher Example@123
  9. [HUAWEI-aaa] local-user admin123 service-type telnet
  10. [HUAWEI-aaa] local-user admin123 privilege level 15
  11. Warning: This operation may affect online users, are you sure to change the user privilege level ?[Y/N]y
  12. [HUAWEI-aaa] return
  13. <HUAWEI> save

四、恢复BootLoad密码


如果忘记了BootLoad密码或者希望修改BootLoad登录密码,用户可以通过以下方式重置或设置新的BootLoad密码。
通过BootLoad修改BootLoad密码 :::success 医疗_消息.png 说明
此方法是在已知BootLoad密码的前提下才可使用。
如果交换机是双主控,则需要在执行以下操作前将备用主控板拔下,待执行完以下操作后,再插上备用主控板,执行save命令以保证主用主控板和备用主控板配置一致。
多台设备堆叠情况下,先将成员交换机下电,在主交换机上完成以下操作后,执行save命令,以保证启动其他成员设备后能同步主交换机上的配置。 ::: 交换机的BootLoad提供了重置BootLoad密码的功能,用户可以在交换机启动过程中修改BootLoad密码,然后保存配置。请按照如下步骤进行配置。

  1. 通过Console口连接交换机,并重启交换机。

    1. 当界面出现以下打印信息时,及时按下快捷键“Ctrl+B”或者“Ctrl+E”并输入BootLoad密码,进入BootLoad主菜单。
      1. Press Ctrl+B or Ctrl+E to enter BootLoad menu ... 2
      2. password: //输入BootLoad密码
  2. 在BootLoad主菜单下选择“Enter password submenu”进入密码子菜单。

  3. 请根据交换机的提示,在密码子菜单下选择“Reset bootload password”或者“Modify bootload password”,对BootLoad密码进行修改。

五、恢复Web登录密码


如果忘记了Web登录密码或者希望修改Web登录密码,用户可以通过Console口、Telnet或STelnet方式登录交换机后设置新的Web登录密码。

  1. # 以用户名为admin123,密码为Example@123为例,配置如下。
  2. <HUAWEI> system-view
  3. [HUAWEI] aaa
  4. [HUAWEI-aaa] local-user admin123 password irreversible-cipher Example@123
  5. [HUAWEI-aaa] local-user admin123 service-type http
  6. [HUAWEI-aaa] local-user admin123 privilege level 15
  7. Warning: This operation may affect online users, are you sure to change the user privilege level ?[Y/N]y
  8. [HUAWEI-aaa] return
  9. <HUAWEI> save

Cisco(思科)


  1. Power-cycle your security appliance by removing and re-inserting the power plug at the power strip.
    重新插拔电源线
    2. When prompted, press Esc to interrupt the boot process and enter ROM Monitor mode. You should immediately see a rommon prompt (rommon #0>).
    按ESC键进入ROM Monitor模式,可以看到提示符rommon #0>
    3. At the rommon prompt, enter the confreg command to view the current configuration register setting: rommon #0>confreg
    输入命令confreg回车,查看当前的寄存器的值
    4. The current configuration register should be the default of 0x01 (it will actually display as 0x00000001). The security appliance will ask if you want to make changes to the configuration register. Answer no when prompted.
    寄存器的初始值为0x01,ASA会出现询问是否改变寄存器的设置,输入no回车
    5. You must change the configuration register to 0x41, which tells the appliance to ignore its saved (startup) configuration upon boot:
    改变寄存器的值为0x41
    rommon #1>confreg 0x41
    6. Reset the appliance with the boot command:
    重启设备
    rommon #2>boot
    7. Notice that the security appliance ignores its startup configuration during the boot process. When it finishes booting, you should see a generic User Mode prompt:
    此时,ASA会跳过startup配置,启动完成后直接进入用户模式
    ciscoasa>
    8. Enter the enable command to enter Privileged Mode. When the appliance prompts you for a password, simply press (at this point, the password is blank):
    进入特权模式,密码为空
    ciscoasa>enable
    Password:
    ciscoasa#
    9. Copy the startup configuration file into the running configuration with the following command:
    将startup配置保存至running配置中
    ciscoasa#copy startup-config running-config
    Destination filename [running-config]?
    10. The previously saved configuration is now the active configuration, but since the security appliance is already in Privileged Mode, privileged access is not disabled. Next, in configuration mode, enter the following command to change the Privileged Mode password to a known value (in this case, we’ll use the password system):
    重新设置特权模式的密码为system
    asa#conf t
    asa(config)#enable password system
    11. While still in Configuration Mode, reset the configuration register to the default of 0x01 to force the security appliance to read its startup configuration on boot:
    改回寄存器的值,强制ASA从startup读取配置启动
    asa(config)#config-register 0x01
    12. Use the following commands to view the configuration register setting:
    查看当前寄存器的值
    asa(config)#exit
    asa#show version
    13. At bottom of the output of the show version command, you should see the following statement: Configuration register is 0x41 (will be 0x1 at next reload)
    在输出的最后会看到寄存器的值会在重启设备后由0x41变成0x1
    14. Save the current configuration with the copy run start command to make the above changes persistent:
    保存配置
    asa#copy run start
    Source filename [running-config]
    15. Reload the security appliance: asa# reload System config has been modified. Save? [Y]es/[N]o:yes
    输入reload命令重启设备,询问是否保存配置,输入yes回车
    Cryptochecksum: e87f1433 54896e6b 4e21d072 d71a9cbf
    2149 bytes copied in 1.480 secs (2149 bytes/sec) Proceed with reload? [confirm]
    When your security appliance reloads, you should be able to use your newly reset password to enter privileged mode.
    设备重启后,你可以使用重置后的密码进入特权模式