All Cisco routers have a 16-bit software register, which is written into NVRAM. By default, the configuration register is set to load the Cisco IOS from flash memory and to look for and load the startup-config file from NVRAM.
By changing the configuration register, you can perform cisco password recovery on a Cisco router.
If you are locked out of a router because you forgot the password, you can change the configuration register to help you recover. Bit 6 in the configuration register is used to tell the router whether or not to use the contents of NVRAM to load a router configuration. The default configuration register value for bit 6 is 0×2102 (the 0 is bit 6), which means that bit 6 is off. With the default setting, the router will look for and load a router configuration stored in NVRAM (startup-config). To recover a password, you need to turn on bit 6, which will tell the router to ignore the NVRAM contents. The configuration register value to turn on bit 6 is 0×2142.
1. You can see the current value of the configuration register by using the show version command (sh version or show ver for short), as in the following example on a router.
The following router is used for this example
Cisco IOS Software, C870 Software (C870-ADVIPSERVICESK9-M), Version 12.4(15)T6, RELEASE SOFTWARE (fc2)
2. The last information given from this command is the value of the configuration register. In this example, the value is 0×2102, which is the default setting.
3. When the router reloads, say no to entering setup mode.
4. Enter privileged mode and then type copy startup-config running-config.
5. Change your passwords and/or username then save your configuration with the copy run start command.
5. Change your configuration register back to 0×2102.