How to Reset Cisco Router and Switch Passwords

I. Router Password Recovery

Follow these steps to recover the router password:

1. Power off the router and power it back on after 10 seconds. While the router is powering on (or within 60 seconds of the router restart), press and hold Ctrl+Break on the keyboard for a few seconds. When the router prompt rommon 1 > appears, enter the command confreg 0x2142 or o/r 0x2142 to modify the configuration register value. The 4 in this value means to skip the startup configuration file startup-config.

2. Enter the reset command to restart the router.

3. When the router finishes restarting and prompts whether to run the configuration wizard, enter “n” to return to the router prompt.

4. Enter the enable command to enter privileged EXEC mode.

5. Enter the copy startup-config running-config command to copy the startup configuration file into the running configuration file.

6. Enter the configure terminal command to enter global configuration mode.

7. Enter the enable secret newpass command to reset the encrypted enable password (if needed, you can also change the enable password and virtual terminal passwords here).

8. Enter the exit command to return to global configuration mode.

9. Enter the config-register 0x2102 command to restore the configuration register value to its default.

10. Enter the exit command to return to privileged EXEC mode.

11. Enter the copy running-config startup-config command to save the running configuration file to the startup configuration file.

12. Enter the reload command to restart the router. At this point, the password recovery process is complete.

13. After the router finishes starting up, press “Enter” several times until the router prompt Router> appears.

14. Enter the enable command to enter privileged EXEC mode. When prompted for a password, enter the newly set encrypted enable password to verify that the password recovery process was performed correctly.

II. Switch Password Recovery

Follow these steps to recover the switch password:

1. Disconnect the switch power and power it back on. While the switch is powering on, press and hold the “Mode” button on the front panel of the switch for a few seconds, and carefully observe the switch startup information displayed in the HyperTerminal program.

2. When the switch prompt switch: appears, enter the flash_init command.

3. After the above command finishes executing, enter the load_helper command.

4. After the above command finishes executing, enter the dir flash: command to view the file list in flash memory.

5. Enter the rename flash:config.text flash:config.back command to rename the file in flash memory that stores the password.

6. Enter the reset command to restart the switch (you can also enter the boot command to continue the switch startup process).

7. When the switch finishes restarting and prompts whether to run the configuration wizard, enter “n” to return to the switch prompt.

8. Enter the enable command to enter privileged EXEC mode.

9. Enter the command rename flash:config.back flash:config.text.

10. Enter the copy flash:config.text system:running-config command and confirm.

11. Enter the configure terminal command to enter global configuration mode.

12. Enter the enable secret newpass command to reset the encrypted enable password (if needed, you can also change the enable password and virtual terminal passwords here).

13. Enter the end command to return to privileged EXEC mode.

Leave a Comment

Your email address will not be published.