Password recovery on a Cisco 2960 switch
Prereqs
Console access
Password recovery mechanism enabled
The password recover mechanism is enabled by default. This is necessary to be able to recover the startup configuration file.
Let's simulate a forgotten password.
Now boot the switch in ROMMON-mode using a cold start.
Initialize Flash manually.
List the files stored in flash. The startup configuration is config.text. If you want to keep it, rename the file. If you want to discard all configuration, delete it. Then boot the switch.
Enter "no" at the initial configuration setup prompt.
Change to privileged exec mode. Copy the contents of the backup startup configuration to the running configuration.
Change the privileged exec password and/or the console password. Restart the switch to verify if everything still works as expected.
Password recovery mechanism disabled
The password recovery mechanism is enabled by default. Disable it. It won't be possible to recover the startup configuration file.
Let's simulate a forgotten password.
First disconnect the power cable from the switch. Minicom gives no output yet.
Now reconnect the power cable. The switch boots and while doing the POST, the SYST LED blinks green. This takes about X seconds. After POST, the blinking LED changes pattern. Access to the boot loader prompt through the password-recovery mechanism is disallowed at this point.
Once the switch is up, there is no password and no startup configuration. Enable the password-recovery mechanism again. Verify.