The below details how to recover a Cisco device such as a switch or router if you have forgotten or don’t have the password. You will need physical access to the console port
If you are new to Cisco or just want to improve your skills I recommend this course from Udemy at the time of writing for just $20 for lifetime access! I’m also a really big fan of Pluralsight
WARNING: By doing this you may loose any configuration on the router.
- Physically connected to the console port using a tool such as Putty
- Power on the Cisco device
- Press the Break key on your keyboard. If you are using a laptop or keyboard without a dedicated break key try FN + Ctrl + B or Ctrl + FN + F11
- You should see the prompt change to rommon
- At the rommon> prompt type confreg 0x2142 and press enter
- Enter reset and press enter
Info: confreg 0x2142 instructs the router/switch not to load the startup configuration on the next reboot. As the configuration holds the passwords, we will not be prompted for them.
- Wait for the router/switch to fully reboot
- When asked if you “Would you like to enter the initial configuration” type no and press enter
- At the router> prompt enter enable and press enter
- Type conf t and press enter
- Type config-register 0x2102 and press enter
Info: config-register 0x2102 puts the router/switch back into its normal mode. Don’t reboot yet
To start will a clean configuration / factory default
- Type copy run start and press enter
- Type exit and press enter
- Type reload and press enter to restart if a nice clean config
If you want to keep your previous configuration and just change the password(s)
Things are a bit more involved here but if you have experience of basic Cisco configuration you will see where I am going.
- Type copy start run to copy the startup configuration in memory and press enter This will reload your previous config passwords an all.
- Now you can go through the configuration and change any passwords you need to, for example to change the enable secret password you would type enable secret <new_password> and press enter. Change your console, ssh and any others you need to
- Type copy run start and press enter to save your changes
- Type exit and press enter
- Type reload and press enter to restart the router/switch with your amended credentials.