当路由器的口令丢失后可以通过以下的方法来恢复,
1 关掉路由器的电源,然后重新打开电源,
2 按ctrl+break键(60秒内),然后按以下操作:
monitor: command "boot" aborted due to user interrupt
rommon 1 > confreg 0x2142   忽略配置文件
rommon 2 > reset                    重启

EASE SOFTWARE (fc1)System Bootstrap, Version 12.1(3r)T2, REL
Copyright (c) 2000 by cisco Systems, Inc.
cisco 2621 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
Self decompressing the p_w_picpath :
########################################################################## [OK]
              Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706
 
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
Technical Support:
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Wed 27-Apr-04 19:01 by miwang
cisco 2621 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
.
Processor board ID JAD05190MTZ (4292891495)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
2 FastEthernet/IEEE 802.3 interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)

         --- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: n 选择命令模式

Press RETURN to get started!
 
Router>en
Router#sh run

Building configuration...
Current configuration : 314 bytes
!
version 12.2
no service password-encryption
!
hostname Router
!
!
!
!
!
ip ssh version 1
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
ip classless
!
!
!
!
!
line con 0     ***********口令已忽略
line vty 0 4
 login
!

!
end

Router#copy startup-config running-config  ***********将启动配置信息复制到运行配置中
Destination filename [running-config]? ********************enter
414 bytes copied in 0.416 secs (995 bytes/sec)
router1#sh run
Building configuration...
Current configuration : 424 bytes
!
version 12.2
no service password-encryption
!
hostname router1
!
!
enable secret 5 $1$mERr$OMRc2VaeIGRijKT/uWJmN0
!
!
!
!
ip ssh version 1
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
 shutdown
!
ip classless
!
!
!
!
!
line con 0
 password p501
 login  ****************************原先的口令,可以修改
line vty 0 4
 password p503
 login
!
!

end

router1#sh version   ***************路由器的名字已变
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
Technical Support:
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Wed 27-Apr-04 19:01 by miwang
Image text-base: 0x8000808C, data-base: 0x80A1FECC
ROM: System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)
Copyright (c) 2000 by cisco Systems, Inc.
ROM: C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
System returned to ROM by reload
System p_w_picpath file is "flash:c2600-i-mz.122-28.bin"
cisco 2621 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
.
Processor board ID JAD05190MTZ (4292891495)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
2 FastEthernet/IEEE 802.3 interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)
Configuration register is 0x2142***************要修改,否则启动忽略配置文件
router1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
router1(config)#conf
router1(config)#config-register 0x2102
router1(config)#line con 0
router1(config-line)#password ou
router1(config-line)#login
router1(config-line)#end
%SYS-5-CONFIG_I: Configured from console by console
router1#copy run
router1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
router1#exit

Press RETURN to get started.
User Access Verification
Password:
router1>en
Password:
router1#
至此口令已经恢复*******************************