Cisco 2960 交换机密码恢复实验

1、连接好Console线并设置好超级终端

2、按住交换机上的mode按钮不放,插上交换机电源线,直到LED灯不再闪烁,松开mode按钮。

3、
输入flash_init
switch: flash_init
Initializing Flash...
flashfs[0]: 540 files, 19 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 32514048
flashfs[0]: Bytes used: 11561472
flashfs[0]: Bytes available: 20952576
flashfs[0]: flashfs fsck took 11 seconds.
...done Initializing Flash.


输入dir flash:(注意flash后面有个冒号)通过该命令确认是否有config.text文件。
switch: dir flash:
Directory of flash:/

    2  -rwx  4120      <date>               multiple-fs
    4  -rwx  2437      <date>               config.text
    5  -rwx  1915      <date>               private-config.text
    7  drwx  192       <date>               c2960-lanbasek9-mz.122-50.SE5

20952576 bytes available (11561472 bytes used)


将config.text文件改名,然后启动交换机。这样就能不加载原先的配置,好比一台新的交换机启动。
switch: rename flash:config.text flash:config.old
switch: boot


Would you like to enter the initial configuration dialog? [yes/no]: no

进入特权模式后将config.text文件恢复原先的名字,保证下一次能正常启动交换机。然后将配置复制到当前的ROM中去。
Switch>en
Switch#rename flash:config.old flash:config.text
Destination filename [config.text]? 
Switch#copy flash:config.text system:running-config
Destination filename [running-config]?
ok

修改telnet和console密码
Switch#conf t
Switch(config)#line vty 0 4
Switch(config-line)#password contoso
Switch(config-line)#login
Switch(config-line)#line console 0
Switch(config-line)#password contoso
Switch(config-line)#login
Switch(config-line)#end

修改特权模式密码,最后保存所做的这些修改到NVROM
Switch#conf t
Switch(config)#enable password contoso
Switch(config)#service password-encryption  (如果不想加密密码,词句可以省略)
Switch(config)#end
Switch#wr


至此密码恢复完成,reload验证一下即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章