Cisco IOS Password Recovery

Cisco IOS Password Recovery

So what have we here, eh? You gone and got yourself locked out of your newly configured 2960? You were midway through applying AAA config before you took a lunchbreak, and your session expired and now you can't get back in? And what's that? You've already tried a power cycle to undo your changes, but your "wr' muscle memory must have written the config to startup and now you're panicking?

Fear not, Friend. Me too.

Let's go fix the mess we have made...

1) With the switch powered down, and locate the MODE button shown below (or guide your remote Engineer in the British Virgin Islands where to find the MODE button)

2) Power up the switch while holding 'Mode' until you see the below message:

The system has been interrupted prior to initializing the
flash filesystem.  The following commands will initialize
the flash filesystem, and finish loading the operating 
system software:

3) Initialise the flash memory with the below command:


4) Check that the flash has initialised correctly, and rename the config file:

dir flash:

You should see the configuration file here, config.text. This is the file that the switch looks for during the bootup sequence, and so we will want to rename this temporarily so that it boots into a fresh default configuration state:

rename flash:config.text flash:config.text.old

5) We can now proceed to booting up the switch:


The switch will offer you the System Configuration Dialog wizard when it boots. Type NO to skip this.

6) Boom, we are in enable mode and can restore our configuration in place without needing to bypass any AAA configuration:

rename flash:config.text.old flash:config.text
copy flash:config.text system:running-config

7) Now you are free to immediately jump to removing any bad configuration you may have applied that got you in this mess in the first place. Once you're happy that you aren't going to be locked out again, make sure to write your changes to the startup-config:



So there we have it! You're back in your switch, I'm back in mine and no Managers are any the wiser. Bravo.

Related Article