How to recover a lost Cisco router and switch password

Published on by dellpe

Firstly, please note, these are the GENERAL procedures but procedures vary on varying devices!

Here is how to recover a lost Cisco router password:
1. Power off and back on the device
2. Hold down control and hit BREAK

3. Once you are at the rommon1> prompt, type confreg 0×2142.

4. The type reset, the device will reboot
5. Once the device is booted, you will know that you are bypassing the config because you will be asked this question (say no):
Would you like to enter the initial configuration dialog? [yes/no]: no
6. Once booted, if you do a show version, you will see that your config register is 0×2142.
7. Now, you can either go to enable mode and do a show startup-config to see what the enable password is OR, if you have an enable secret password set, you can replace it by doing a copy start run, then going into global configuration and creating a new enable secret with enable secret cisco, then copy it back with copy run start.
8. Now, you want to change the config register back. In global configuration, type config-register 0×2102
9. Save your configuration with wr or copy run start
10. Reboot the device and you should be back with your original configuration but with a password that you know!

AS with switch,for example cisco 2960, you may do as follows:

1. Power off and back on the device

2. hit MODEM button on the switch for a few seconds.

3. Once you are at the switch:> prompt, type flash_init and press enter.

4. Now type load_helper and press enter

5. Now type dir flash: and press enter. The config.text file is what stores the administrative password that is keeping you from logging into the router. To get rid of this file, use this command: rename flash:config.text flash:config.old
6. Next, boot the switch using the boot command

7. Next, enter enable mode with the en or enable command. Then, type the following commands:

rename flash:config.old config.text

copy flash:config.text system:running-config

8. After each command, you will be prompted to confirm the name of the destination file. Do this by pressing enter each time.

9. Now you can reset your enable password to whatever password you want, for example,

enable password 3anetwork

10. Saving your configuration with the copy running-config startup-config command. You will be prompted to confirm the name of the destination file. Press enter.

You have successfully reconfigured your switch’s enable password using the password recovery procedure. Even better, you were able to do this while preserving the entire switch configuration.

This is the end of the article. I am Dong, a network engineer from Cisco wholesaler 3Anetwork.com. If you have any further questions, you may feel free to contact me:dong@3anetwork.com.

To be informed of the latest articles, subscribe:
Comment on this post