Monday 20 May 2013

How to reset passwords on a Cisco Catalyst Switch ?

Hi, today we'll discuss on how to reset all passwords on a Cisco Catalyst switches.

Steps

1. Make sure you are connected to the switch via console connection.

2. Power down the switch.

3. While the switch is turned off, press and hold "Mode" button that is located in front, on the left side of the switch. Please refer below image.



4. Next, power on the switch. Remember, you still need to hold the "Mode" button.

5. Release the "Mode" button after approximately 5 seconds when the Status (STAT) LED goes out. When you release the Mode button, the SYST LED blinks amber.

6. The console message will be displayed like this:

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-12 starting...
Base ethernet MAC Address: 00:0d:bc:01:a0: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:

7. Enter command "flash_init".

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

8. Then, enter command "load_helper", nothing will happen next.

switch: load_helper

9. Enter "dir flash:" command. The switch file system will be displayed as below.

switch: dir flash:

Directory of flash:/

2    -rwx  660       <date>               vlan.dat
7    -rwx  2412      <date>               config.text
3    -rwx  3132319   <date>               c2950-i6q4l2-mz.121-22.EA14.bin
5    -rwx  316       <date>               env_vars
6    -rwx  5         <date>               private-config.text
21   -rwx  109       <date>               info
22   -rwx  109       <date>               info.ver

4602368 bytes available (3139072 bytes used)
switch:

10. Type in rename flash:config.text flash:config.old. config.text is where the password (that you have forgotten) is stored.

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

11. Enter "boot" command. This command will reboot the switch (obviously). 

switch: boot

Loading "flash:/c2950-i6q4l2-mz.121-22.EA14.bin"...##############################################################

12. When you see "Press RETURN to get started!" , type rename flash:config.old flash:config.text to rename the configuration file to its original file.

SwitchB#rename flash:config.old flash:config.text
Destination filename [config.text]

13. Then, type copy flash:config.text system:running-config to copy the configuration file into the memory.

SwitchB#copy flash:config.text system:running-config
Destination filename [running-config]?
840 bytes copied in 0.772 secs (1088 bytes/sec)
SwitchB#

14. Finally, please configure a new password to your Switch, and please remember it. Otherwise, you'll need to repeat these steps again. :D

SwitchB(config)#enable secret xxx
SwitchB(config)#enable password xxx

SwitchB(config)#line vty 0 15
SwitchB(config-line)#password xxx
SwitchB(config-line)#login

SwitchB(config)#line con 0
SwitchB(config-line)#password xxx

15. Write the running configuration to the configuration file with the write memory command.

SwitchB# write memory

I hope this post will benefit you guys. Thank you for dropping by.

- Soulpower

No comments:

Post a Comment