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驗證一下即可。

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