欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

思科Catalyst交换机密码恢复妙招

程序员文章站 2023-08-29 09:23:41
思科Catalyst交换机密码恢复妙招...
  如果交换机的login密码忘记了咋办啊?
  别急别急,只要你有pc,有类似超级终端(hyper terminal)这样是终端程序,连接到交换机的console口,那么密码的恢复就简单了。
  
  1.对于catalyst 2900/3500xl系列来说:
  拔下交换机的电源线,然后按住交换机的mode按钮,再重新插上交换机的电源线.直到端口port 1x的led熄灭之后释放mode按钮。
  就这么简单,别告诉我你不知道mode按钮在哪啊。
  
  2.对于catalyst 2940/2950l系列来说:
  拔下交换机的电源线,然后按住交换机的mode按钮,再重新插上交换机的电源线.直到stat的led熄灭之后释放mode按钮。
  
  3.对于catalyst 2955系列来说:
  catalyst 2955没有没有外部的mode按钮,因此就不能使用之前的那种方法来进行密码恢复.在交换机启动时,对于windows系列的pc,按下ctrl+break键;对于unix系列的工作站,按下ctrl+c.如下:
  c2955 boot loader (c2955−hboot−m) version 12.1(0.0.514), cisco development test
  version
  compiled fri 13−dec−02 17:38 by madison
  ws−c2955t−12 starting...
  base ethernet mac address: 00:0b:be:b6:ee:00
  xmodem file system is available.
  
  initializing flash...
  flashfs[0]: 19 files, 2 directories
  flashfs[0]: 0 orphaned files, 0 orphaned directories
  flashfs[0]: total bytes: 7741440
  flashfs[0]: bytes used: 4510720
  flashfs[0]: bytes available: 3230720
  flashfs[0]: flashfs fsck took 7 seconds.
  ...done initializing flash.
  boot sector filesystem (bs:) installed, fsid: 3
  parameter block filesystem (pb:) installed, fsid: 4
  /---接下来交换机会在15秒内自动启动,等出现该信息之后,按下ctrl+break键或ctrl+c键----/
  
  the system has been interrupted prior to initializing the flash file system to finish
  loading the operating system software:
  flash_init
  load_helper
  bootswitch:
  
  接下来输入flash_init命令:
  switch:flash_init
  initializing flash...
  flashfs[0]: 143 files, 4 directories
  flashfs[0]: 0 orphaned files, 0 orphaned directories
  flashfs[0]: total bytes: 3612672
  flashfs[0]: bytes used: 2729472
  flashfs[0]: bytes available: 883200
  flashfs[0]: flashfs fsck took 86 seconds
  ....done initializing flash.
  boot sector filesystem (bs:) installed, fsid: 3
  parameter block filesystem (pb:) installed, fsid: 4
  switch:
  
  接着输入load_helper命令:
  switch:load_helper
  switch:
  
  再输入dir flash:命令显示交换机的文件系统:
  switch:dir flash:
  directory of flash:/
  2 −rwx 1803357 c3500xl−c3h2s−mz.120−5.wc7.bin
  4 −rwx 1131 config.text
  5 −rwx 109 info
  6 −rwx 389 env_vars
  7 drwx 640 html
  18 −rwx 109 info.ver
  403968 bytes available (3208704 bytes used)
  switch:
  
  把配置文件重命名:
  switch:rename flash:config.text flash:config.old
  switch:
  
  输入boot命令启动交换机:
  switch:boot
  loading "flash:c3500xl−c3h2s−mz.120−5.wc7.bin"...###############################
  ################################################################################
  ######################################################################
  file "flash:c3500xl−c3h2s−mz.120−5.wc7.bin" uncompressed and installed, entry po
  int: 0x3000
  executing...
  (略)
  
  不进入setup模式:
  −−− system configuration dialog −−−
  at any point you may enter a question mark '?' for help.
  use ctrl−c to abort configuration dialog at any prompt.
  default settings are in square brackets '[]'.
  continue with configuration dialog? [yes/no]: n
  
  进入特权模式,恢复原始的配置文件:
  switch#rename flash:config.old flash:config.text
  destination filename [config.text]
  switch#
  
  把配置文件保存在内存里:
  switch#copy flash:config.text system:running−config
  destination filename [running−config]?
  1131 bytes copied in 0.760 secs
  switch#
  
  进入全局配置模式,取消密码设置:
  switch(config)#no enable secret
  
  保存配置:
  switch#write memory
  building configuration...
  [ok]
  switch#
  
  搞定了@_@
  
  4.对于catalyst 3550/3750系列来说:
  1.通过带有支持xmodem协议的超级终端程序的pc连接到交换机的console口,把波特率设置为9600。
  2.拔掉交换机的电源。
  3.按下交换机上的mode按钮,与此同时,重新插上交换机的电源线。当交换机端口1x上的led熄灭后可以松开mode按钮1到2秒,之后将显示一些指示信息:
  the system has been interrupted prior to initializing the flash file system. the following
  commands will initialize the flash file system, and finish loading the operating system
  software:
  flash_init
  load_helper
  boot
  switch#
  4.初始化flash文件系统:
  switch#flash_init
  5.加载帮助文件:
  switch#load_helper
  6.显示闪存里的内容:
  switch#dir flash:
  7.重命名配置文件:
  switch#rename flash:config.text flash:config.text.old
  8.启动系统,并且如果提示进入setup模式,输入n:
  switch#boot
  continue with the configuration dialog? [yes/no]: n
  9.进入特权模式,把配置文件名恢复为原始文件名:
  switch#rename flash:config.text.old flash:config.text
  10.把配置文件写进内存:
  switch#copy flash:config.text system:running-config
  source filename [config.text]?
  destination filename [running-config]?
  11.进入全局配置模式更改密码:
  switch(config)#enable secret {password}
  12.退出,并保存到startup-config文件里:
  switch(config)#copy running-config startup-config
  
  其实有的时候硬件安全比软件安全还要重要些.不然人人都抗个本本,.连根线到console口去恢复密码了。