Tuesday, March 22, 2016

How to Recover a Password on a CISCO 2950 Switch

1. Restart the Switch while holding the Mode Button.
********************************************************
C2950 Boot Loader (C2950-HBOOT-M) Version 12.1(11r)EA1, RELEASE SOFTWARE (fc1)
Compiled Mon 22-Jul-02 17:18 by antonino
WS-C2950-24 starting...
Base ethernet MAC Address: 00:18:18:00:8a:40
Xmodem file system is available.

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:

2. Run the flash_init command as shown on the console
*****************************************************

switch: flash_init
Initializing Flash...
flashfs[0]: 379 files, 4 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 4759040
flashfs[0]: Bytes available: 2982400
flashfs[0]: flashfs fsck took 9 seconds.
...done initializing flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4
switch:


3. Verify if the config.text is in the flash
*********************************************

switch: dir flash:
Directory of flash:/

2    -rwx  109       <date>               info
3    -rwx  303       <date>               env_vars
4    -rwx  676       <date>               vlan.dat
5    -rwx  736       <date>               vlan.dat.renamed
6    -rwx  1323      <date>               config.text.renamed
7    -rwx  5         <date>               private-config.text.renamed
8    -rwx  3110758   <date>               c2950-i6q4l2-mz.121-22.EA6.bin
9    drwx  4160      <date>               html
378  -rwx  109       <date>               info.ver
379  -rwx  1182      <date>               config.old
380  -rwx  1224      <date>               config.old2
381  -rwx  5         <date>               private-config.text
382  -rwx  1200      <date>               config.old3
383  -rwx  1337      <date>               config.text

2982400 bytes available (4759040 bytes used)

4. Rename the Config.text file to other name preferred.
******************************************************
switch: rename flash:config.text flash:conifg.zamani

5. Verify if the file has been changed.
***************************************
switch: dir flash:
Directory of flash:/

2    -rwx  109       <date>               info
3    -rwx  303       <date>               env_vars
4    -rwx  676       <date>               vlan.dat
5    -rwx  736       <date>               vlan.dat.renamed
6    -rwx  1323      <date>               config.text.renamed
7    -rwx  5         <date>               private-config.text.renamed
8    -rwx  3110758   <date>               c2950-i6q4l2-mz.121-22.EA6.bin
9    drwx  4160      <date>               html
378  -rwx  109       <date>               info.ver
379  -rwx  1182      <date>               config.old
380  -rwx  1224      <date>               config.old2
381  -rwx  5         <date>               private-config.text
382  -rwx  1200      <date>               config.old3
383  -rwx  1337      <date>               conifg.zamani

2982400 bytes available (4759040 bytes used)

6. Run the Boot Command to reload the Switch
*********************************************
switch: boot

1 comment: