博客园  :: 首页  :: 管理

关于思科C2950交换机清除密码,恢复初始配置的方法

Posted on 2015-12-08 11:29  520_1351  阅读(3208)  评论(0编辑  收藏  举报

上个月河南做项目,因需要大批量的对服务器进行操作系统的安装,于是想到了PXE网络批量安装,

好不容易到机房的仓库找到网线及一台思科交换机,但到安装的时候,发现思科交换机里应该有配置了

通过配置线连接交换机,又发现又设置了enable密码,于是笔者只能想到恢复初始配置,遂将实现过程整理如下:

 

1、按住前面板的mode键不放,插上电源,等3-5秒后松开mode键,我们将会看到如下提示:

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、到这里我们输入flash_init命令,开始初始化flash,完了后,我们再输入ren flash:config.text flash:config.old

     命令对已存丰的config.text重新命名成config.old,不删除、方便以后还可以恢复,最后我们在使用boot命令进行启动

switch: flash_init
Initializing Flash...
flashfs[0]: 18 files, 2 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 3966464
flashfs[0]: Bytes available: 3774976
flashfs[0]: flashfs fsck took 6 seconds.
...done initializing flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4
switch: dir

List of filesystems currently registered:

               flash[0]: (read-write)
              xmodem[1]: (read-only)
                null[2]: (read-write)
                  bs[3]: (read-only)

switch: 

3、这样我们等启动好了,再次使用enable命令进入特权模式就没有密码了,还可以使用dir命令查看到我们重命名的文件,如下所示:

Switch>en
Switch#dir
Directory of flash:/

    2  -rwx     2664051   Mar 01 1993 00:03:22  c2950-i6q4l2-mz.121-11.EA1.bin
    4  -rwx        1216   Apr 15 1994 21:28:58  vlan.dat
    5  -rwx        4413   Jan 31 1994 21:45:53  config.old
    6  -rwx           5   Jan 31 1994 21:45:53  private-config.text
    7  drwx         704   Mar 01 1993 00:04:00  html
   19  -rwx         109   Mar 01 1993 00:04:01  info
   20  -rwx         109   Mar 01 1993 00:04:01  info.ver
   21  -rwx         269   Jan 01 1970 00:01:46  env_vars

7741440 bytes total (3774976 bytes free)
Switch#

 

尊重别人的劳动成果 转载请务必注明出处:http://www.cnblogs.com/5201351/p/5028575.html