Password recovery on a Cisco 2960 switch
Prereqs
- a PC (BIOS/UEFI) running Linux Mint 21
- minicom terminal emulation software
- a serial console cable
- a Cisco 2960 24TT-L or 24TC-L Plus switch
- a working IOS, but inaccessible (forgotten console and/or enable password)
Setup
Situation
The "console password" and "enable password" (Privileged EXEC mode) are - amongst other switch configuration settings - stored in startup-config (NVRAM). Recovery of a lost password is only useful if you have a inacessible (but working) IOS. If not, you have a bigger problem and have to (re)install an IOS operating system first.
No access to the console.
ROMMON
Boot the switch in ROMMON-mode using a cold start. If the password recovery mechanism is enabled, it is possible to either keep the startup configuration file or choose to discard it. If the password recovery mechanism is disabled, you are forced to discard all device configuration.
Password recovery mechanism enabled
List the files stored in flash. The startup configuration file in this mode is named "config.text".
Optional: should you choose to keep the startup configuration file, temporary rename that file. If not, skip this step.
Optional: should you choose to discard the startup configuration file, delete that file. If not, skip this step.
Password recovery mechanism disabled
If the password recovery mechanism is disabled, it was not possible to keep the startup configuration file and you had to reset the system back to the default configuration.
List the files stored in flash. The startup configuration file is absent!
IOS
At this point, there is no startup configuration file (only a backup startup configuration file, if chosen). Enter "no" at the initial configuration setup prompt and change to privileged exec mode.
If you have a backup startup configuration file and want to restore it, copy the contents of the backup startup configuration file to the running configuration and delete that backup file. If not, skip this step.
Set the necessary password(s) and obscure the console clear-text password.
Copy the running configuration to the startup configuration. Restart the switch.