There can be certain situation where we may loose access to a Cisco CSR router and due to that we would not be able to login to the device. In such situations we can do password recovery of Cisco router to regain access to the device, by password recovery we will not loose any configuration of the device.
Note: Password recovery need reboot of the device.
Step 1> Get console access of the device. For this example we have used CSR1000v router.
Step 2> Power cycle the device.
Step 3> Once the device power on we will get below window. During this window press escape to stop the normal OS boot.
Once the boot is stopped press c to get into the GRUB mode. We will get below option after c is pressed.
Now we need to change the register value to ignore the original running config. Enter confreg and type Y for the 3 questions.
Press Escape to go back to previous window and hit enter to boot the router with blank configuration.
Once the router boot it will have no previous configuration in it.
Step 4> Copy the original configuration to startup configuration by running command copy startup-config running-config
Step 5> Now go to configuration mode and create new username and password and enable password. Using this username and password we can login to the router. If we need to update any other configuration we can do that as well.
Step 6> Change the config register to 0x2102 using command config-register 0x2102 so that router will not ignore the running config upon boot.
Step 7 > Now copy the running config back to start-up config using below command, this will override the existing running config with new username and password.
Step 8> Reload the router using reload command.
By following above 8 steps we have successfully performed password recovery of Cisco router.