設備提供以下方法恢復Console口密碼。html
方法一:經過STelnet/Telnet登陸設備修改Console口密碼。web
方法二:在BootROM下配置清除Console口密碼啓動後,修改Console口密碼。安全
方法三:在BootROM菜單下取消設置下次啓動配置文件,設備以空配置啓動後修改Console口密碼。服務器
說明:ide
請優先使用方法一,若是STelnet/Telnet密碼也忘記了再使用其它兩個方法。使用Telnet協議存在安全風險,建議用戶使用STelnet V2登陸設備。工具
在方法一不可用的狀況下優先使用方法二。ui
S1720GFR、S2720、S2750、S5700LI、S5700S-LI、S5720S-12TP-PWR-LI-AC和S5700S-28P-PWR-LI-AC爲BootROM菜單,S5710-X-LI、S5700S-28X-LI-AC、S5700S-52X-LI-AC、S5720SI、S5720S-SI、S5720EI、S5720HI、S5720LI、S5720S-LI、S6720EI和S6720S-EI爲BootLoad菜單。this
如下設備回顯僅做舉例,不一樣設備,不一樣版本,回顯可能會稍有不一樣,請以設備的實際顯示爲準。spa
如下涉及的命令行及回顯信息以STelnet登陸設備修改Console口密碼爲例。命令行
若是用戶擁有STelnet帳號,而且具備3級或更高的權限,則能夠經過STelnet登陸到設備後修改Console口密碼,而後保存配置。
使用STelnet帳號登陸設備,並確認當前帳號有3級或更高的權限。
使用display users命令查看當前設備全部登陸用戶。其中帶「+」標記行爲當前用戶,記錄對應的編號VTY1。
<HUAWEI> display users User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag 129 VTY 0 00:23:36 TEL 10.135.18.67 pass no Username : Unspecified+ 130 VTY 1 01:20:36 TEL 10.135.18.91 pass no Username : Unspecified 131 VTY 2 00:00:00 TEL 10.135.18.54 pass no Username : Unspecified
使用display user-interface命令能夠顯示全部用戶的權限,肯定VTY1對應的等級爲15,有權限修改Console口密碼。
<HUAWEI> display user-interface Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int 0 CON 0 9600 - 15 - P - + 129 VTY 0 - 15 15 P - + 130 VTY 1 - 15 15 P - + 131 VTY 2 - 15 - P - 132 VTY 3 - 15 15 P - ......
修改Console用戶的密碼,以修改成密碼認證,密碼爲「huawei@123」爲例。
<HUAWEI> system-view[HUAWEI] user-interface console 0[HUAWEI-ui-console0] authentication-mode password[HUAWEI-ui-console0] set authentication password cipher huawei@123[HUAWEI-ui-console0] return
爲了防止重啓後配置丟失,保存配置。
<HUAWEI> saveThe current configuration will be written to the device. Are you sure to continue?[Y/N]yNow saving the current configuration to the slot 0. Save the configuration successfully.
設備的BootROM提供了清除Console口密碼的功能,能夠在用戶使用Console口登陸的時候跳過密碼檢查。這樣系統啓動後除了不須要輸入Console密碼外,與正常啓動相同,也會完成全部配置加載。設備啓動後從新配置驗證方式和Console口密碼,而後保存配置。
注意:
要進入到BootROM菜單須要重啓設備,會致使業務中斷,請視具體狀況作好設備備份,並儘可能選擇業務量較少的時間操做。
清除Console口密碼登陸後請立刻配置新的密碼。
在此操做過程當中不要對設備進行下電。
用串口線鏈接設備,而後重啓。當出現「Press Ctrl+B to enter BootROM menu...」(V200R002及V200R003版本)或者「Press Ctrl+B or Ctrl+E to enter BootROM menu ...」(V200R005及之後發佈的版本)打印信息時,按下「Ctrl+B」或者「Ctrl+E」並鍵入密碼(缺省爲「Admin@huawei.com」,V100R006C03以前版本可能爲「huawei」),進入BootROM主菜單。
清除Console口登陸密碼。
BootROM MENU 1. Boot with default mode 2. Enter serial submenu 3. Enter startup submenu 4. Enter ethernet submenu 5. Enter filesystem submenu 6. Modify BootROM password //V200R006及以前版本:Modify BootROM password V200R007及以後版本:Enter password submenu 7. Clear password for console user 8. Reboot (Press Ctrl+E to enter diag menu) Enter your choice(1-8): 7Note: Clear password for console user? Yes or No(Y/N): yClear password for console user successfully. Choose "1" to boot, then set a new password. Note: Do not choose "8. Reboot" or power off the device, otherwise this operation will not take effect.
根據設備的提示,在BootROM主菜單下選擇「1」啓動設備。
完成系統啓動後,經過Console口登陸時不須要認證,登陸後配置Console口密碼,以修改成密碼認證,並修改密碼爲「huawei@123」爲例。
<HUAWEI> system-view[HUAWEI] user-interface console 0[HUAWEI-ui-console0] authentication-mode password[HUAWEI-ui-console0] set authentication password cipher huawei@123[HUAWEI-ui-console0] return
爲了防止重啓後配置丟失,保存配置。
<HUAWEI> saveThe current configuration will be written to the device. Are you sure to continue?[Y/N]yNow saving the current configuration to the slot 0. Save the configuration successfully.
在BootROM下取消設置下次啓動配置文件,設備會以空配置(出廠配置)啓動。啓動後將原配置文件導出,手動修改其中關於Console口登陸的配置。將修改後的配置文件從新上傳至設備,配置設備以修改後的配置文件啓動,重啓後的設備將無需輸入Console口登陸密碼。(如下舉例以Console口下配置了Password認證爲例,其它認證方式以設備實際狀況爲準。)
注意:
要進入到BootROM菜單須要重啓設備,會致使業務中斷,請視具體狀況作好設備備份,並儘可能選擇業務量較少的時間操做。
在此操做過程當中不要對設備進行下電。
V200R010及以後版本Console口默認爲AAA認證,若是空配置啓動後沒有修改認證方式,配置設備以刪除認證方式後的配置文件啓動時,重啓後的設備須要輸入缺省的用戶名admin和密碼admin@huawei.com,此種狀況下的回顯,以設備實際顯示爲準。
用串口線鏈接設備,而後重啓,當出現「Press Ctrl+B to enter BootROM menu...」(V200R002及V200R003版本)或者「Press Ctrl+B or Ctrl+E to enter BootROM menu ...」(V200R005及之後發佈的版本)打印信息時,按下「Ctrl+B」或者「Ctrl+E」並鍵入密碼(缺省爲「Admin@huawei.com」,V100R006C03以前版本可能爲「huawei」)後進入BootROM主菜單。
清空啓動配置文件,使設備以空配置啓動。
說明:
注意記錄設備當前配置文件名,以便後續恢復原配置。
BootROM MENU 1. Boot with default mode 2. Enter serial submenu 3. Enter startup submenu 4. Enter ethernet submenu 5. Enter filesystem submenu 6. Modify BootROM password //V200R006及以前版本:Modify BootROM password V200R007及以後版本:Enter password submenu 7. Clear password for console user 8. Reboot (Press Ctrl+E to enter diag menu) Enter your choice(1-8): 3 Startup Configuration Submenu 1. Display startup configuration 2. Modify startup configuration 3. Return to main menu Enter your choice(1-3): 2Note: startup file field can not be cleared '.'=clear field; 'Ctrl+D'=quit; Enter=use current configuration startup type(1: Flash) current: 1 new : Flash startup file (can not be cleared) current: HUAWEI-v200r008c00.cc new : saved-configuration file current: vrpcfg.zip new : . //清空當前值patch package current: new : Startup Configuration Submenu 1. Display startup configuration 2. Modify startup configuration 3. Return to main menu Enter your choice(1-3): 3
在BootROM主菜單下選擇「1」啓動設備。
完成系統啓動後,設備會恢復爲出廠配置。V200R009及以前版本經過Console口登陸時,提示設置Console口密碼,以密碼爲「huawei@123」爲例。
An initial password is required for the first login via the console. Continue to set it? [Y/N]:ySet a password and keep it safe. Otherwise you will not be able to login via the console. Please configure the login password (8-16) Enter Password: //輸入huawei@123Confirm Password: //再次輸入huawei@123
V200R010及以後版本經過Console口登陸時,提示輸入Console口的默認用戶名和密碼,以後會提示修改密碼,此時必須修改密碼,以密碼爲「huawei@123」爲例。
Login authentication Username:admin Password: //輸入admin@huawei.com Warning: The default password poses security risks. The password needs to be changed. Change now? [Y/N]: y Please enter old password: //輸入admin@huawei.com Please enter new password: //輸入huawei@123 Please confirm new password: //再次輸入huawei@123 The password has been changed successfully.
恢復原配置。當前設備爲默認的出廠配置,若但願恢復設備原配置,又不想保留原配置文件中關於Console密碼的配置,能夠下載原配置文件到PC上,手動刪除Console下配置後,上傳至設備,指定爲下次啓動文件,重啓設備。
配置設備爲FTP服務器。
<HUAWEI> system-view[HUAWEI] ftp server enableInfo: The FTP server is already enabled.[HUAWEI] vlan 10[HUAWEI-vlan10] interface vlanif 10 //配置VLANIF10做爲管理接口。[HUAWEI-Vlanif10] ip address 10.110.24.254 24[HUAWEI-Vlanif10] quit[HUAWEI] interface gigabitethernet 0/0/10 //GE0/0/10爲使用Web網管登陸Switch的PC與Switch相連的物理接口編號,請按照實際現網狀況進行選擇。[HUAWEI-GigabitEthernet0/0/10] port link-type access[HUAWEI-GigabitEthernet0/0/10] port default vlan 10[HUAWEI-GigabitEthernet0/0/10] quit[HUAWEI] aaa[HUAWEI-aaa] local-user huawei password irreversible-cipher huawei@123[HUAWEI-aaa] local-user huawei ftp-directory flash:[HUAWEI-aaa] local-user huawei service-type ftp[HUAWEI-aaa] local-user huawei privilege level 15
下載原配置文件vrpcfg.zip到PC。
C:\Documents and Setting\Administrator> ftp 10.110.24.254鏈接到 10.110.24.254。 220 FTP service ready. 用戶 (10.110.24.254:(none)): huawei331 Password required for huawei. 密碼: 230 User logged in. ftp> get vrpcfg.zip200 Port command okay. 150 Opening ASCII mode data connection for directory list. 226 Transfer complete. ftp: 收到 981 字節,用時 0.01秒 981000.00千字節/秒.
在PC上解壓後使用文本編輯工具(建議用系統自帶的文本編輯工具)打開並刪除Console口認證配置,刪除後從新壓縮成vrpcfg.zip文件。需刪除的配置以下所示:
# user-interface maximum-vty 15 user-interface con 0 authentication-mode password //需手動刪除 set authentication password cipher %@%@:*IB+w7j~""GlU$0-;\#m@Jw%@%@ //需手動刪除# user-interface con 0 authentication-mode aaa //需手動刪除 user privilege level 15 //需手動刪除
將修改後的配置文件保存後,上傳到設備,替換原配置文件。
ftp> put vrpcfg.zip200 Port command okay. 150 Opening ASCII mode data connection for directory list. 226 Transfer complete. ftp: 發送 981 字節,用時 0.00Seconds 978000.00千字節/秒.
設置修改後的配置文件爲下一次啓動配置文件,選擇不保存配置重啓設備。
<HUAWEI> startup saved-configuration vrpcfg.zipInfo: Succeeded in setting the configuration for booting system. <HUAWEI> reboot fastSystem will reboot! Continue ? [y/n]:y
重啓後,會再次提醒設置Console登陸密碼,輸入一個安全並方便本身記憶的密碼後,回車,進入命令行界面。