Steps of Password Recovery for Cisco 2960 Switch:
Power off the switch first, then press and hold the 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.
The switch should then give you this prompt:
To initialize the flash file system, run the command:
flashfs: 5 files, 1 directories
flashfs: 0 orphaned files, 0 orphaned directories
flashfs: Total bytes: 32514048
flashfs: Bytes used: 8059904
flashfs: Bytes available: 24454144
flashfs: flashfs fsck took 10 seconds.
...done Initializing Flash.
The switch will now print a bunch of messages about the flash memory, hopefully one of them will be ‘done initializing flash’ as above shown
You can now list the contents of your flash by running
switch: dir flash:
Directory of flash: /
2 -rwx 12300 <date> config.text
4 -rwx 1906 <date> private-config.text
5 -rwx 676 <date> vlan.dat
6 -rwx 8040418 <date> c2960-lanbasek9-mz.122-50.SE3.bin
7 -rwx 2072 <date> multiple-fs
There should be a file named ‘config.text’, as you can rename this file as follows:
switch: rename flash:config.text flash: oldconfig.backup
To further boot the switch run the boot command as:
This will start the boot you are used to. When the switch is booted up, you will realize that the configuration is gone. But you are enabled on the switch now.
To recover the old configuration:
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.
Just remember to change your password now !