Power cycle the router.
2. Press the Break key (for Windows 2000, press Control-Break) to enter into boot ROM mode. The Control-Break key sequence must be entered within 60 seconds of the router restarting after a power cycle. Other terminal applications will have their own sequence, so make sure that you consult the help files.
3. After you are in ROM mode, change the configuration register value to ignore the startup configuration file that is stored in NVRAM. Use the o/r 0x2142 command (2500 series routers). For Cisco IOS 12.2T (2600 models and higher) or later the command is confreg 0x2142.
4. Allow the router to reboot by entering the i command.
5. After the router has finished booting up (you will be prompted to enter the setup dialoganswer no or press Control-c to abort the setup dialog) without its startup configuration, look at the show startup-config command output. If the password is encrypted, move to Step 6, which requires you to enter enabled mode (type enable and you will not be required to enter any password) and copy the startup configuration to the running configuration with the copy startup-config running-config command. Then, change the password. If the password is not encrypted and the enable secret command is not used, simply document the plain-text password and go to Step 8.
6. Because the router currently has no configuration in RAM, you can enter enabled mode by simply typing enable (no password is required). Copy the startup configuration to RAM with the IOS command copy startup-config running-config.
7. Enable all active interfaces.
8. Change the configuration register to 0x2102 (default) with the global IOS command config-register 0x2102. Note that this IOS command is automatically saved and there is no need to write changes to NVRAM when modifying the configuration register even though the IOS image will prompt you to save when you do perform a reload.
9. After saving the configuration, you can optionally reload the router.
10. Check the new password if it is not encrypted. If the password is encrypted, simply enter enabled mode and verify your password.
These are the generic steps for password