文章目录
前言设备的两种管理方式远程登录本地登录
场景:远程登录失败场景:远程和本地都登录失败清除Console口密码重置设备配置
其它:设备恢复出厂设置
前言
作为一名网络运维人员,您大概率遇到过这样的棘手场景:一台常年稳定运行、几乎无需维护的老旧网络设备,某天突然发生故障,急需登录后台排查问题时,却发现手头的账号密码完全无法使用。面对这种情况该如何处理?今天,就为您详细拆解网络设备密码的高效处理方案,重点讲解路由器与交换机忘记密码时的专业解决办法,帮您高效恢复设备管理权限。(备注:是企业级的通信设备,不是我们家庭常用的路由器)
设备的两种管理方式
远程登录
在网络管理场景中,远程登录是管理员通过目标设备预设的管理 IP,采用 Telnet(明文传输协议)、或 Web 可视化界面等标准方式,建立远程连接并执行设备配置、状态监控等管理行为的技术手段。
SSH(加密传输协议)

本地登录
本地登录的实现方式为:以 console 线作为物理传输介质,将个人计算机(PC)与目标设备的 console 端口进行连接,待连接建立后,即可通过 PC 端发起登录请求,从而获得设备的本地管理权限。



不管是远程登录还是本地登录,都涉及软件SecureCRT(当然您也可以使用其它类型的软件)。
场景:远程登录失败
若远程登录设备的操作未能成功,其原因可能是 SSH 等相关服务运行异常,也可能是账号密码认证失败,面对这两种情况,现场本地登录将成为唯一的处理途径。
场景一:大量老旧且无需频繁登录进行维护操作的设备,其 Console 口往往未设置访问密码。
现场使用Console登录,可以直接登录到设备中,然后在根据远程登录的错误处理问题。
如账号密码错误,就重置账号密码信息。
aaa
local-user zhanghao1 password irreversible-cipher MiMa1 -- 这里重置密码
local-user zhanghao1 service-type ssh
local-user zhanghao1 level 3
local-user zhanghao1 state block fail-times 3 interval 5
如果是SSH服务错误,就坚持SSH服务配置
stelnet server enable
#
user-interface vty 0 4
authentication-mode aaa
user privilege level 3
idle-timeout 0 0
protocol inbound ssh
#
# 还有用户配置,就不再赘述
<Router>disp ssh server status
SSH Version : 2.0
SSH authentication timeout (Seconds) : 60
SSH authentication retries (Times) : 3
SSH server key generating interval (Hours) : 0
SSH version 1.x compatibility : Disable
SSH server keepalive : Enable
SFTP IPv4 server : Disable
SFTP IPv6 server : Disable
STELNET IPv4 server : Enable
STELNET IPv6 server : Enable
SNETCONF IPv4 server : Enable
SNETCONF IPv6 server : Enable
SNETCONF IPv4 server port(830) : Disable
SNETCONF IPv6 server port(830) : Disable
SCP IPv4 server : Disable
SCP IPv6 server : Disable
SSH IPv4 server port : 22
SSH IPv6 server port : 22
ACL name :
ACL number : 2007
ACL6 name :
ACL6 number :
SSH server ip-block : Enable
场景二:有Console口密码,可以尝试一些常用的账号密码或密码信息。
Console口认证有两种方式,。
一种是关联aaa认证,此时是需要输入账号和密码信息。一种是password认证,只需要输入密码信息即可
一般工程师开局,为了方便维护,都会使用一些简单的,常用的密码认证。如 admin/admin,Admin@123,Huawei@123 等都是较为常见的,可以测试看看。
场景:远程和本地都登录失败
还有一种情况就是,远程不能登录,到现场本地登录,发现正好密码一直也是认证失败,没有正确的账号密码信息。
通信设备的系统和电脑系统有些类似。电脑是在设备启动时可以进入BIOS设置,通信设备也是一样。可以重启设备,在设备完全启动前,进入设备的系统设置中去。
清除Console口密码
操作步骤:
1,设备重启,提示输入 Ctrl+B
2,输入密码,进行系统设置
3,找到选项
Clear password for console user
4,选择,系统重新载入,设备启动后,不需要再输入Console密码
Boot with default mode
第二步,输入Ctrl+B后,提示输入密码。这个是一个设备类型的默认密码,可以在网上查询到(找设备型号基本都可以查询到),也可以尝试输入Admin@huawei.com
这个密码是设备(类似BIOS)初始化的密码,正常现网是没有改动过该密码。
清除Console密码后,注意选择BootROM主菜单下的“1. Boot with default mode”进行启动,不能选择“8. Reboot”,也不能掉电,否则配置将会失效。
Initialize VFS, please waiting ......Done.
Press Ctrl+B to Enter Main Menu ... 2 -- 有提示时就赶快输入 Ctrl+B(两个按键一起按)
Password: ******** -- 输入设备(类似BIOS)初始化的密码
BootROM MENU
1. Boot with default mode
2. Enter serial submenu
3. Enter startup submenu
4. Enter ethernet submenu
5. Enter filesystem submenu
6. Modify BootROM password
7. Clear password for console user -- 找到该选项
8. Reboot
(Press Ctrl+E to enter diag menu)
Enter your choice(1-8): 7
Note: Clear password for console user? Yes or No(Y/N): y
Clear 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 operation will not take effect.
重置设备配置
还有一种情况就是(类似BIOS)的设置中,没有清除Console口密码的选项,那就只能重置设备配置了。重置完设备配置,该设备就作为一台新的设备,需要维护人员重新刷新配置。
操作步骤:
1,设备重启,提示输入 Ctrl+B
2,输入密码,进行系统设置
3,找到选项(带有Configuration字眼的选项)
Reset Factory Configuration
4,选择,重启设备,设备所有信息清空
Reboot
Initialize VFS, please waiting ......Done.
Press Ctrl+B to Enter Main Menu ... 2
Password: ********
You are using the default password. Please set a new password.
========================< Main Menu >========================
| <1> Boot System |
| <2> Set Startup Application Software and Configuration |
| <3> File Management Menu... |
| <4> Load and Upgrade Menu... |
| <5> Modify Bootrom Password |
| <6> Reset Factory Configuration |
| <0> Reboot |
| ----------------------------------------------------------|
| Press Ctrl+T to Enter Manufacture Test Menu... |
| Press Ctrl+Z to Enter Diagnose Menu... |
=============================================================
Enter your choice (0-6): 6
NOTE: This operation will destroy current configuration.
Choose 'yes' to continue, or 'no' to stop and return.
<1> Yes
<0> No
Enter your choice(0-1): 1
Restoring factory configuration ...Done.
========================< Main Menu >========================
| <1> Boot System |
| <2> Set Startup Application Software and Configuration |
| <3> File Management Menu... |
| <4> Load and Upgrade Menu... |
| <5> Modify Bootrom Password |
| <6> Reset Factory Configuration |
| <0> Reboot |
| ----------------------------------------------------------|
| Press Ctrl+T to Enter Manufacture Test Menu... |
| Press Ctrl+Z to Enter Diagnose Menu... |
=============================================================
Enter your choice (0-6): 0
System will reboot in 3 seconds, please wait ...
其它:设备恢复出厂设置
在粘贴一部分数据,如果您有该需求。
如果您已经可以登录该设备,但需要全部重新配置,即【恢复设备配置的初始化】
那么您可以使用 reset saved-configuration 的命令,在重启 reboot 设备。后面的选项记得选择 N 和 Y 。
<Router> reset saved-configuration
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y
Warning: Now clearing the configuration in the device.
Info: Succeeded in clearing the configuration in the device.
<Router> reboot
Info: The system is now comparing the configuration, please wait.
Warning: The configuration has been modified, and it will be saved to the next startup saved-configuration file flash:/vrpcfg.zip. Continue? [Y/N]:n
Info: If want to reboot with saving diagnostic information, input 'N' and then execute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y
以上便是博主基于实际工作中遇到的忘记密码的处理方法,希望对您有用。您可以关注微信公众号,后续我会更新更多的实操案例和讲解,希望对您有用,更多关于数通设备的资料,持续更新中,欢迎您的关注!
数通工程师
如果觉得这些经验对你有用,不妨动动手指,再顺手
点赞起来,方便后续回看或分享给有需要的朋友 —— 您的每一份支持,都是我继续分享的动力,感谢阅读!
收藏















暂无评论内容