The idea
Example commands and output on this page were written from Cisco IOS documentation and generally described behaviour. They were not captured from a live device, so prompts and details can differ on your platform and version.
Passwords live in the startup configuration. If the router boots without reading it, there is no enable password to enter. You then copy the saved configuration into memory yourself, change the password, and set the register back. These steps assume a typical Cisco router with a console cable and a terminal program.
Step by step
- Connect to the console and power cycle the router. Within 60 seconds, send a Break (in many terminal programs, Ctrl+Break, or Ctrl+C on some platforms). The prompt changes to
rommon 1 >. - Set the register to ignore NVRAM and restart:
rommon 1 > confreg 0x2142 rommon 2 > resetROMMON commands; the prompt number increases after each command.
- Answer no to the initial configuration dialog and press Enter to reach the
Router>prompt, then enterenable. No password is asked. - Copy the saved configuration into the running configuration and set a new password:
Router# copy startup-config running-config Router# configure terminal Router(config)# enable secret NewStrongPassw0rd Router(config)# config-register 0x2102 Router(config)# interface GigabitEthernet0/0 Router(config-if)# no shutdown Router(config-if)# end Router# copy running-config startup-configInterfaces are shut down after a boot without a configuration, so enable each one you need. Passwords here are placeholders.
- Check the register is restored and reload when convenient:
show versionshould end with0x2102.
Common mistakes
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Why it is also a security lesson
Recovery works because the device trusts physical access. Locked rooms, console passwords and, where you accept the trade-off, no service password-recovery are the controls.
Test yourself
In password recovery, which value do you set in ROMMON to boot without the startup configuration?
After booting with 0x2142, why must you run copy startup-config running-config before saving?
What is the main protection against this recovery method?