TechKnowSurge
Cisco CCNA 5.3 Cisco CCNA 2.8 Cisco CCST Networking 5.5 Cisco CCNA 5.4
VideoNetworkFree

DEMO: Recovering from lost password, Router

Cisco router password recovery involves bypassing the startup configuration via ROM Monitor mode, resetting the enable secret, and restoring the configuration registry to its normal boot value. The process preserves all existing device settings while granting full administrative access.

Complete this video to capture a CTF flag worth 1 point.

About this video

When administrative access to a Cisco router is lost due to a forgotten enable password, recovery is possible without erasing the device configuration. The process begins by restarting the router and interrupting the boot sequence using the Control+Break key combination to enter ROM Monitor (ROMmon) mode. From there, the configuration register is set to 0x2142, which instructs the router to bypass the startup configuration file on its next reload, allowing entry into privileged EXEC mode without a password prompt. After the router reboots into a minimal state, the startup configuration is loaded into running memory using the copy startup-config running-config command, restoring all previous interface settings and configurations. A new enable secret is then assigned in global configuration mode, and the updated running configuration is saved back to startup with copy running-config startup-config. Finally, the configuration register is returned to its standard value of 0x2102 so the router resumes normal boot behavior and loads its configuration file on all subsequent restarts, leaving the device fully operational with a known password and no loss of existing settings.

What you'll learn

What's covered

Router Password Recovery

Aligned to

Cisco CCNA
5.3 Configure and verify device access control using local passwords
2.8 Describe network device management access
5.4 Describe security password policy elements
Cisco CCST Networking
5.5 Run basic show commands on a Cisco network device

Key terms

Router
A network device that forwards data packets between networks based on IP addresses.
Configuration Register
A hexadecimal value on a Cisco device that instructs the bootstrap program how to behave at startup, including which IOS to load, whether to enter ROMmon mode, or whether to bypass the configuration file.
ROM Monitor Mode
ROMmon
A low-level operating environment on Cisco routers used for recovery tasks when the normal IOS cannot load or must be bypassed.
Startup Configuration
A saved configuration file stored in NVRAM that is loaded into RAM during the boot process to configure the device's settings and parameters.
Running Configuration
The active configuration file stored in RAM that reflects all current settings on a Cisco device; changes are lost on restart if not saved.
Enable Secret Password
A strongly encrypted password on a Cisco router that restricts access to privileged EXEC mode.

Topics

Cisco Routers Password Recovery Rom Monitor Configuration Register Enable Secret Networking

Transcript

Recovering from a lost password on a router

The process is very similar to a switch, in that what we're going to do is essentially tell the machine to bypass the configuration file, then reload everything with a fresh configuration, then import the old configuration file in and change the password.

What I have to do is restart this router, and then during this restart process I have to hit the Ctrl+Break in order to get into the ROMmon mode. So that's the step we're going to take first: I'm going to reset this router and get into ROMmon mode by holding down the Ctrl+Break keys.

Setting the register to bypass the configuration

Now that we're in ROMmon mode, what I'm going to do is configure the registry so that it will bypass the configuration file. The way we do that is we type in the command confreg 0x2142, and that is the code to bypass the configuration file. Let's go ahead and hit enter. Then it says you must restart to take on the new configuration, so next I'm going to restart this device.

Now that I've restarted this router, it clearly doesn't have its configuration file — or it skipped its configuration file — because it's asking for initial configuration. I am not going to do an initial configuration with this. We see that there are some interfaces that are coming up and coming down there.

Loading the saved configuration back in

Next what I can do is get into the enable mode, and now I've bypassed the password, so I'm in this device.

The next command takes the configuration file and loads it into the running configuration, and that is copy start run. We're taking the startup file and we're copying it to the running file, because right now there's not a configuration that's running on this. So I'm going to do copy start run, and we're going to copy it over, and yes we do. That should now do the configuration on this device and bring everything up to par.

Next what we're going to do is a show run, to take a look and make sure that all of our configurations are on here. Yes, in fact it is — we see our configurations on this device.

Setting a new password and saving

Next what we're going to do is enable — oh, I do need to be in the global configuration mode. So let's get in the global configuration mode and we'll do enable secret, and then we'll do that same secure two as we had before, and we hit enter on that. Now that password is configured on there.

Now we need to save this, so we'll exit out of here and copy, and this time we're going to go from the running configuration to the startup configuration. We'll accept that, and now this is saved with the new password.

Restoring the register

The one last thing that we need to do is set it so that when this gets reloaded it's not going to bypass the configuration file again. To do that we have to be in the global configuration mode, and within the global configuration mode we're going to type register and then the registry setting that's going to not bypass the configuration file but actually load it up, and that is two one zero two. So we need to type in 0x2102.

If I want to verify that, I could exit and do a show version, and I will scroll through here and take a look at it: it will be set to 2102 at the next reload. And there you have it — we are now set up and good to go, and we've bypassed the password and still kept all of our same configurations.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →