Step by step how to reset cisco router password without loosing configuration.
1- reboot the router
2- Enter in to rom monitor mode by pressing Ctrl+Brek key (rommon 1>)
3- Change configreg to bypass to load startup config
rommon 2 > configreg 0x2142
4- Reset or reboot the router by
rommon 2 > reset
5- When router will boot it will ask for initial configuration
Press “N” do not go to initial configuration steps
6- Go to privilage exec mode by typing
Router > en
Router#
7 Check the startup configuration
Router# show startup-config
8- now copy your startup-config to your running-config
Router# copy startup-config running-config
9- Go to globel configuration mode
Router# config t
10-change the password
Router(config)#enable secret cisco
11-Now copy your running config to your startup config
Router#copy
12-Now change the configreg to load startup config
13-Router(config)#config-register 0x2102
14 save the changes
Router#copy run start
15 reboot the router
Now you can login with your new password without loosing your configuration.