思科c2960交换机忘记密码恢复配置文件方法

先将console接入电脑,再按住交换机mode键后通电,终端出现这些英文后松开

或者按住mode按钮直到sys灯不闪动(常亮状态)直到出现switch:模式

image-20210729132353043

初始化flash flash_init

image-20210729151445998

查询flash所有文件 dir flash:

image-20210729152621030

重命名备份 config.text文件 rename flash:config.text flash:config.text.old

image-20210729152910973

boot启动交换机 boot

image-20210729153130049

操作下面这一步,要先用tftp备份好文件

Switch#rename flash:config.old flash:config.text #恢复交换机配置文件 Switch#copy flash:config.text system:running-config #copy配置到DRAM

步骤九: 这时就可以设置新的密码了: 1、 Switch(config)#conf t Switch(config)#enable secret 12345678

2、 或用下面方法暂时清空密码,以后再做设置 Switch(config)#no enable password #删除特权模式旧密码

Switch(config)#no enable secret #去除加密密码 Switch#copy run start #把当前配置的文件写回Flash