Sometimes there is a need to reset unknown password on Cisco switch, without loosing configuration. It is not possible on standard way, because – switch is not accessible without this password.
- Connect Switch to computer using console cable plugged on console cable
- Prepare software as Putty for communication to switch
- Hold the mode button located at the front of the switch on the left side
- Power off and then power on switch. Switches does not power button, so it should be done by unplugging and plugging power cable
- When characters appear on the screen release the mode button
- Press ctrl + pause/break on the keyboard. Use USB keyboard if laptop is in use
- Enter on switch flash and rename setup file, so it can not be find and loaded after restart, then restart
Switch:flash_init Switch:dir flash: Switch:rename flash:config.text flash:config.backup Switch:boot
- After switch restart and load IOS without settings, rename back config files and disable passwords
Would you like to enter the inital configuration dialog? no Switch > enable Switch#rename flash:config.backup config.text Switch#copy flash:config.text system:running-config Switch#config terminal Switch(config)#no enable secret. Switch(config)#exit Switch(config)#wr
Now new password can be set using standard procedure
More information you can find there