Free tech learning for everyone, from basics to pro

Routing & SwitchingNetworking SecurityIntermediate

Password recovery on Cisco routers and switches: ROMMON, the config register and the mode button

In short: With physical console access you can reset lost passwords on most Cisco devices. On routers you interrupt the boot, set the configuration register so the saved configuration is ignored, copy the configuration back in and set new passwords. Catalyst switches use the mode button or a ROMMON variable. Disabling password recovery protects devices in unsafe locations, at the cost of a full reset if you lose the password.

Why this works, and why it matters

Password recovery needs physical access to the console port and a reload. That is the security model: anyone who can touch the device and power-cycle it can take control. So recovery is a normal admin skill, and it is also the reason network cabinets should be locked.

Router password recovery (ISR, config register method)Console +reloadsend BreakROMMONconfreg 0x2142Bootstartup-configignoredCopy configstartup torunningNew passwordconfreg0x2102, save
Figure 1. The configuration register tells the router to skip the saved configuration for one boot.

Routers (ISR 4000 and similar)

  1. Connect a console cable (9600 baud, 8N1) and power-cycle the router.
  2. Within the first 60 seconds of boot, send a Break (Ctrl+Break in PuTTY, or the terminal's break key). The router stops at the rommon 1 > prompt.
  3. Type confreg 0x2142 and then reset. The 0x2142 value tells the router to ignore NVRAM contents on boot.
  4. The router boots with no configuration. Answer no to the setup dialogue, then enable (no password is needed).
  5. Copy the saved configuration into memory: copy startup-config running-config. Do not do it the other way round, or you will erase your configuration.
  6. Set new passwords: enable secret ... and new line or user passwords. Interfaces may now be shut down, so bring them up with no shutdown.
  7. Restore the normal register: config-register 0x2102, then copy running-config startup-config and reload.

Catalyst switches

On Catalyst 9000 switches, hold the Mode button while powering on (or for about 10 seconds during boot) to reach the switch: ROMMON prompt. Then:

switch: SWITCH_IGNORE_STARTUP_CFG=1
switch: boot
...
Switch# copy startup-config running-config
Switch(config)# enable secret New-Example-Pass
Switch(config)# no system ignore startupconfig switch all
Switch# write memory

Older Catalyst 2960 and 3560 switches used flash_init and renamed config.text instead; the idea is the same.

Disabling password recovery

For devices in shared or public spaces, no service password-recovery stops the console break from exposing the configuration. If someone uses the recovery procedure, the device erases its configuration before letting them in. Only use this if you keep secure, offline backups of every configuration, because you will have to rebuild the device if you lose the password.

Good practice to avoid needing recovery

  • Use AAA with RADIUS or TACACS+ for logins, plus a strong local fallback account stored in a password manager.
  • Use enable secret with type 8 or 9 hashing (algorithm-type scrypt), not the old enable password or type 7.
  • Keep configuration backups off the device, for example with the archive feature or a tool like Oxidized.

Real-world example: the forgotten branch router

A company bought a small business and found a router in its cabinet with no known passwords and no documentation. An engineer visited with a console cable, used the 0x2142 method, copied the old configuration in, and set new credentials connected to the company's TACACS+ server. The whole job took 20 minutes and the existing VPN tunnels came back unchanged.

Practice

Which configuration register value makes a Cisco router ignore its startup configuration?
0x2142.
During recovery, which way should you copy the configuration and why?
copy startup-config running-config, so the saved configuration is loaded without being overwritten.
What does no service password-recovery do when someone tries the recovery procedure?
It only allows recovery by erasing the configuration first.

Key takeaways

  • Password recovery needs console access and a reload, so physical security matters.
  • Routers use confreg 0x2142; switches use the Mode button and ROMMON.
  • Copy startup to running, set new passwords, then restore 0x2102 and save.
  • AAA, strong hashing and off-device backups reduce the need for recovery.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: