January 30, 2012

Password Recovery Steps for Cisco Catalyst 2960 Switch

Step 1:
Connect your PC to the console port of the Cisco switch and open terminal emulation Software on your PC (Ex. Hyper Terminal).
Use the following terminal emulation settings:
  • Bits per second (baud): 9600
  • Data bits: 8
  • Parity: None
  • Stop bits: 1
  • Flow Control: Xon/Xoff
Cisco Password Recovery




Step 2:
First Power off the switch, then press and hold ”mode button” while you power on the switch again. Hold it for about 15 seconds until the SYS led is solid green, and then release it.
switch should then give you this prompt:
switch:

Step 3:
To initialize the flash file system, execute the flash_init command:
switch: flash_init
Initializing Flash…
flashfs[0]: 5 files, 1 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 32514048
flashfs[0]: Bytes used: 8059904
flashfs[0]: Bytes available: 24454144
flashfs[0]: flashfs fsck took 10 seconds.
…done Initializing Flash.
The switch will now give a bunch of messages about the flash memory, hopefully one of them will be ‘done initializing flash’ as above shown

Step 4:
You can now list the contents of your flash by running
switch: dir flash:
Directory of flash: /
2 -rwx 12300 config.text
4 -rwx 1906 private-config.text
5 -rwx 676 vlan.dat
6 -rwx 8040418 c2960-lanbasek9-mz.122-50.SE3.bin
7 -rwx 2072 multiple-fs


Step 5:
There should be a file named ‘config.text’, in the Flash directory. Now you have to rename this file as follows:
switch: rename flash:config.text flash: oldconfig.backup


Step 6:
Now run the Switch by using  boot command as:
switch: boot

Step 7:
When the switch is booted, then old configuration will be gone.Enable switch now using below command.
Switch>enable
Switch#

Step 8:
To recover the old configuration, change the configuration file and re-name back to “config.text”.
Switch#rename flash: oldconfig.backup flash:config.text
And now to replace the running configuration with the backup
Switch#copy flash: config.text running-config
Destination filename [running-config]?
Press enter, and you will have your old switch configuration back and you are enabled.

Step 9:
Copy the configuration file into memory.
Switch#copy flash:config.text system:running-config
Destination filename [running-config]?—–Press Return or Enter.1131 bytes copied in 0.760 secs
Switch#
The configuration file is now reloaded.

Step 10:
Overwrite the current passwords that you do not know.
Switch# conf t
Switch(config)#enable secret
Switch(config)#enable password
Switch(config)#line vty 0 15
Switch(config-line)#password
Switch(config-line)#login
Switch(config-line)#line con 0
Switch(config-line)#password
Write the running configuration to the configuration file with the write memory
Switch#write memory
Building configuration..
[OK]
Switch#

Step 11:
Reload the switch using the reload command to cross verify new login details.
Switch#reload

Note: The password recovery procedure can be different depending on the Cisco switch series, so you should refer to the product documentation before you attempt a password recovery.

Reference:
1.http://www.cisco.com/en/US/products/sw/iosswrel/ps1831/products_tech_note091
86a00801746e6.shtml
2.CCNA Exploration 4.0 – 2.4 Configuring Switch Security