Recovering from a Lost or Forgotten Password (Catalyst 3750 Series)

ccnp-switching
Step by step procedure to recover a lost or forgotten password on a Catalyst 3750 switch by renaming the configuration file from the boot loader.
Published

Nov 19, 2017

  1. Power off the standalone switch or the entire switch stack.
  2. Reconnect the power cord to the standalone switch and, within 15 seconds, press the Mode button while the System LED is still flashing green. Continue pressing the Mode button until the System LED turns briefly amber and then solid green; then release the Mode button.

If you see this message, proceed with Password Recovery Enabled below; otherwise proceed with the steps here

The password-recovery mechanism is enabled.

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:

    flash_init
    load_helper
    boot


switch:
  1. Initialize the flash file system and display the contents of flash memory:
    switch: flash_init Initializing Flash… flashfs[0]: 4 files, 1 directories flashfs[0]: 0 orphaned files, 0 orphaned directories flashfs[0]: Total bytes: 15998976 flashfs[0]: Bytes used: 8659968 flashfs[0]: Bytes available: 7339008 flashfs[0]: flashfs fsck took 9 seconds. …done Initializing Flash. Boot Sector Filesystem (bs) installed, fsid: 3 Setting console baud rate to 9600… switch: dir flash: Directory of flash:/

2 -rwx 8625186 c3750-ipservicesk9-mz.122-35.SE2.bin 3 -rwx 29769 config.text 4 -rwx 676 vlan.dat 5 -rwx 1935 private-config.text

7339008 bytes available (8659968 bytes used)
  1. Rename the configuration file to something like config.text.old. This file contains the password definition. Then boot the system
    switch: rename flash:config.text flash:config.text.old
    switch: boot
  2. When the switch is booted up, go to privilege mode and rename the configuration file to its original name:
    Switch#rename flash:config.text.old flash:config.text

Note: Before continuing to Step 9, power on any connected stack members and wait until they have completely initialized. Failure to follow this step can result in a lost configuration depending on how your switch is set up.

  1. Copy the configuration file into memory:
    Switch#copy flash:config.text system:running-config
    Destination filename [running-config]?
    

Press Return in response to the confirmation prompts. The configuration file is now reloaded, and you can change the password.

  1. Enter global configuration mode and change the password:
    HMLADMP01C01#configure terminal
    HMLADMP01C01(config)#enable secret test
    HMLADMP01C01(config)#username test privilege 15 password test
    HMLADMP01C01(config)#line console 0
    HMLADMP01C01(config)#password test
  2. Write the running configuration to the startup configuration file in privilege mode:
    HMLADMP01C01(config)#end
    HMLADMP01C01#copy running-config startup-config
    The new password is now in the startup configuration.
Back to top