Catalyst 2950的密码恢复原理
v     拔下交换机电源,用手按住交换机“Mode” 按钮,插上电源,等待交换机进入控制台模式。
v     交换机的启动配置文件保存在NVRAM中的config.text中,修改把它修改为config.old重启交换机,这是交换机在启动时就不会读取启动配置文件了。
v     然后进行特权模式修改密码,并保存配置。从而破掉特权密码。
Catalyst 2950的密码恢复步骤
v      拔下交换机电源,用手按住交换机“Mode” 按钮,插上电源,等待交换机进入控制台模式。其提示符为“switch:”
C2950 Boot Loader (C2950-HBOOT-M) Version 12.1(11r)EA1, RELEASE SOFTWARE (fc1)
Compiled Mon 22-Jul-02 17:18 by antonino
WS-C2950SX-24 starting...
Base ethernet MAC Address: 00:0d:28:9b:4d:80
Xmodem file system is available.
 
The system has been interrupted prior to initializing the
flash filesystem.  The following commands will initialize
the flash filesystem, and finish loading the operating
system software:
 
    flash_init
    load_helper
    boot
 
v      switch:flash_init    //初始化flash文件系统
Initializing Flash...
flashfs[0]: 10 files, 2 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 2679808
flashfs[0]: Bytes available: 5061632
flashfs[0]: flashfs fsck took 7 seconds.
...done initializing flash.         
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4
v      switch:dir flash:    //命令显示flash中所保存的配置文件的名称。
Directory of flash:/
 
2    -rwx  1469      <date>               ?
3    drwx  128       <date>               lost+found
5    -rwx  1469      <date>               config.old
8    -rwx  1004      <date>               vlan.dat
9    -rwx  1472      <date>               up
7    -rwx  2664051   <date>               c2950-i6q4l2-mz.121-11.EA1.bin
10   -rwx  1460      <date>               y
11   -rwx  1670      <date>               config.old2
12   -rwx  5         <date>               private-config.text 交换机密码保存的地方
 
5061632 bytes available (2679808 bytes used)
v      switch:rename  flash:config.text   flash:config.old  //命令把原来的配置文件改名为config.old。(NVRAM是从flash虚拟的,flash:config.text =startup-config
v      switch:reboot  //命令把原来的配置文件改名为config.old。重新启动交换机,这时交换机找不到其配置文件(所以配置文件中的特权密码也就无效),系统就会提示是否进入配置对话(configuration dialog)” ,选择“N”
################################################################################
 
File "flash:/c2950-i6q4l2-mz.121-11.EA1.bin" uncompressed and installed, entry p
oint: 0x80010000
executing...
 
              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) C2950 Software (C2950-I6Q4L2-M), Version 12.1(11)EA1, RELEASE SOFTWARE
(fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Wed 28-Aug-02 10:25 by antonino
Image text-base: 0x80010000, data-base: 0x80528000
 
 
Initializing flashfs...
flashfs[1]: 9 files, 2 directories
flashfs[1]: 0 orphaned files, 0 orphaned directories
flashfs[1]: Total bytes: 7741440
flashfs[1]: Bytes used: 2677760
flashfs[1]: Bytes available: 5063680
flashfs[1]: flashfs fsck took 6 seconds.
flashfs[1]: Initialization complete.
Done initializing flashfs.
POST: System Board Test : Passed
POST: Ethernet Controller Test : Passed
ASIC Initialization Passed
cisco WS-C2950SX-24 (RC32300) processor (revision B0) with 20402K bytes of memor
y.
Processor board ID FOC0925X3G0
Last reset from system-reset
Running Standard Image
24 FastEthernet/IEEE 802.3 interface(s)
 
32K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address: 00:0D:28:9B:4D:80
Motherboard assembly number: 73-5781-12
Power supply part number: 34-0965-01
Motherboard serial number: 28-4641-05
Power supply serial number: PHI071407DY
Model revision number: B0
Motherboard revision number: B0
Model number: WS-C2950-24
System serial number: FOC0925X3G0
 
         --- System Configuration Dialog ---
 
Would you like to enter the initial configuration dialog? [yes/no]:
00:00:13: POST: Loop back Test Failed on GigabitEthernet0/1. State:Disabled
 
00:00:13: POST: Loop back Test Failed on GigabitEthernet0/2. State:Disabled
 
00:00:13: %SPANTREE-5-EXTENDED_SYSID: Extended SysId enabled for type vlan
00:00:17: Gi0/1 can't be brought up because it failed POST in loopback test
00:00:17: Gi0/2 can't be brought up because it failed POST in loopback test
00:00:17: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(11)EA1, RELEASE SOFTWARE
(fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Wed 28-Aug-02 10:25 by antoninocpd_port_enable: port 24 xcvr_enable_lin
k: FALSE
cpd_port_enable: port 25 xcvr_enable_link: FALSE
 
00:00:19: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up
00:00:19: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to up
00:00:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, ch
anged state to up
00:00:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, ch
anged state to up
00:00:51: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state t
o up
% Please answer 'yes' or 'no'.
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]:
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]:
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]:
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]: no
 
 
 
Press RETURN to get started!
 
 
Switch>
00:01:01: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively do
wn
00:01:02: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state t
o down
v      switch>#enable     //进入特权执行模式。
v      switch:rename  flash:config.old  flash:config.text   //把配置文件名字修改回来
Destination filename [config.text]?
%Error renaming flash:config.old to flash:config.text (No such file or directory)
 
v      switch:copy flash:config.text running-config   //把配置文件从FLASH中装载到RAM中。
v      Switch# config terminal  //进入全局配置模式
v      Switch(config)# no enable password  //删除使能密码
v      Switch(config)# no enable secret  //删除加密的密码
v      Switch(config)#end   //直接返回到特权模式  
v      Switch# show runnig-config //查看正在进行的配置文件,请注意查看密码
v      Switch# copy running-config startup-config    //备份配置文件到NVRAM
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#exit
 
Switch con0 is now available
Press RETURN to get started.