If you forget the password for your Cisco Router, it’s easy to recover it. I recently encountered a situation where I couldn’t recall enable password or enable secret of a Cisco Router.
To resolve this, you will have to enter into the recovery mode and follow the password recovery procedure provided in this blog post, which successfully helped me retrieve the password.
The steps given in this blog post are from Cisco Router 4331 ISR, however, you can use the same steps on other Cisco router models as well. Please note that the Router will be offline during this process because it needs to be restarted.
Steps to Recover Password/Secret of a Cisco Router
- Connect to the Cisco router using putty.
- Restart the Cisco Router and interrupt the boot sequence by using the Break option in putty. You can find this option under Special Command > Break as shown in below screenshot.
- After interrupting the boot sequence, you will see rommon 1 > prompt. Type ? And press Enter to view the list of available commands in this prompt. We will be using
confreg
command.
- Skip the startup-config file, which holds all the passwords. To do this, type confreg on the console and press Enter. You’ll notice that the current configuration register value is 0x2102. We need to change it to 0x2142.
- Change the confreg value to 0x2142.
- Now, reset the Cisco router, and it will restart while bypassing the startup-config.
- You will now see the Router> prompt, indicating that you have entered the configuration with no settings.
- Use the en command to access the enable or privilege mode.
- To preserve the configuration in your startup-config, Copy startup-config to running-config. You will notice that the router name, which was saved in your startup-config, has been applied. Command: copy startup-config running-config.
- Enter the Conf t mode to update the router passwords. Once you are done, change the config-register value back to 0x2102. Be sure to save all the changes before rebooting the router. You can use the
write mem
command to save the startup-config to running-config.
- Resetting the Config-Register value to its original setting, which is 0x2102. Save the configuration using
write mem
and then restart the router.
That’s it! After rebooting the router, it will operate according to the configuration in the startup-configuration file.