| 136 | |
| 137 | === Recover from a forgotten password === |
| 138 | This is one of our favorite situations. In some cases one student might change a password on a device and then not be in class after they have done this. Or, a student does not use the suggested class password and forgets what they typed. Or, a student makes a typo while configuring a device's password and save the configuration and exits from the console. |
| 139 | |
| 140 | This recovery method simulates what you would do on an actual Cisco router with a console cable were this to happen. |
| 141 | |
| 142 | First go to dynagen and type: |
| 143 | {{{ |
| 144 | => confreg <DEVICE NAME> 0x2142 |
| 145 | }}} |
| 146 | 0x2142 is the default register on cisco devices to tell the router to ignore the saved config, but not lose the configuration. |
| 147 | |
| 148 | Next connect to your device via the console. That is telnet to localhost on the correct port for the device. |
| 149 | {{{ |
| 150 | telnet localhost <PORT OF THE DEVICE> |
| 151 | }}} |
| 152 | You will see something like this. Press ENTER as requested: |
| 153 | {{{ |
| 154 | Would you like to enter the initial configuration dialog? [yes/no]: |
| 155 | }}} |
| 156 | Answer '''no''' to the above question and you will see a bunch of informational text. Press ENTER one more time and you will arrive to the device prompt: |
| 157 | {{{ |
| 158 | Router> |
| 159 | }}} |
| 160 | Now go in to administrative mode with enable |
| 161 | {{{ |
| 162 | Router> en |
| 163 | }}} |
| 164 | If you do: |
| 165 | {{{ |
| 166 | Router# show run |
| 167 | }}} |
| 168 | Now you can set your enable password (Or you can add any config). An example of this would look like: |
| 169 | {{{ |
| 170 | Router# conf t |
| 171 | Router(config)#service password-en |
| 172 | Router(config)#service password-encryption |
| 173 | Routerconfig)#enable secret <CLASS PASSWORD> |
| 174 | Router(config)#exit |
| 175 | Router#wr mem |
| 176 | }}} |
| 177 | Now exit from the Telnet session: |
| 178 | {{{ |
| 179 | ctrl-] |
| 180 | telnet> quit |
| 181 | }}} |
| 182 | Now return to the dynagen prompt and do: |
| 183 | {{{ |
| 184 | => confreg <DEVICE NAME>0x2102 |
| 185 | => reload DEVICE NAME> |
| 186 | }}} |
| 187 | And test that your new user and password are working as expected using telnet again to the correct port on localhost or telnet directly to the router's IP address if one has been set. |
| 188 | |
| 189 | If ssh access had been configured you may need to reconfigure that as well at this point. |