路由器 交換機密碼恢復

spacer.gif

1.配置Console口密碼

Router(config)#line console 0

Router(config-line)#password 123

Router(config-line)#login

完成配置後,查看show run

 

line con 0

 password 123

 login

line vty 0 4

 login

2.配置特權模式密碼

Router(config)#enablepassword 123 明文密碼

Router(config)#enable secret123.com 加密密碼

show run

enable secret 5$1$mERr$MNp8Yo5Mas8GUpxpr0GfR1

enable password 123

3.配置加密明文密碼

 

Router(config)#servicepassword-encryption

Show run

enable secret 5$1$mERr$MNp8Yo5Mas8GUpxpr0GfR1

enable password 7 08701E1D

4.配置VTY密碼,遠程登陸密碼

Router(config)#line vty 0 4

Router(config-line)#password123

Router(config-line)#login

二:路由器密碼恢復

1.  重啓路由器。並同時按下ctral+breack鍵中斷IOS的加載,路由器進入ROM Monitor模式。

Self decompressing the p_w_picpath:

###########################################

monitor: command"boot" aborted due to user interrupt

rommon 1 >

2.  將配置寄存器的值更改爲0x2142,表示在啓動時忽略startup-config的配置。

 

rommon 1 > confreg 0x2142

rommon 2 > reset

3.  路由器將再次重啓,由於更改了配置寄存器的值。路由器將無法加載配置文件、因此也就不會再有登陸密碼。

 

4.  進入配置模式後。將配置文件手動加載回來。

Router#copy startup-config running-config

5.  通過show run 命令查看路由器配置了那些密碼,逐一更改密碼。

6.  修改配置寄存器的值,並保存配置,

 

Router(config)#config-register0x2102

Router(config)#exit

Router#copy running-configstartup-config

 

2.交換機的密碼恢復

交換機密碼被保存在falsh中的配置文件config.txt中,通過“dir”命令查看。

Switch#dir

Directory of flash:/

 

    1 -rw-     3117390          <no date>  pt3000-i6q4l2-mz.121-22.EA4.bin

 

64016384 bytes total(60898994 bytes free)

1.  拔掉交換機的插頭。

2.  重新插好電源。立刻按住交換機的‘mode’鍵,當看到配置界面顯示‘switch:’命令提示,便可鬆開‘mode’鍵。這表示已經進入到一個專門用來做故障恢復的簡單IOS,由於沒有密碼,正常的IOS無法進入,所以只能先在這裏做一些參數設定。

3.  使用上面提示的命令‘flash_init’,初始化Flash.

4.  將config.text文件名改成config,old.

5.  重啓交換機

Switch:boot

6.  恢復其他參數,把配置文件的名字改回來。

Switch# rename flash:config.old flash:config.txt

7.  手工加載配置文件。

Switch:copy flash:config.text system:running-config

8.  配置文件加載完成後,需要進入配置模式修改密碼,最後保存配置,完成密碼的恢復。

 

 

 



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