密碼遺忘
本章介紹了Console口丢失的處理方法,建議使用者妥善保管密碼,并定期修改。
恢複Console口密碼
裝置提供如下方法恢複Console口密碼。
•方法一:通過STelnet/Telnet登入裝置修改Console口密碼。(推薦)
•方法二:在BootROM下配置清除Console口密碼啟動後,修改Console口密碼。
•方法三:在BootROM菜單下取消設定下次啟動配置檔案,裝置以空配置啟動後修改Console口密碼。
方法一:通過STelnet/Telnet登入裝置修改Console口密碼。
以下涉及的指令行及回顯資訊以STelnet登入裝置修改Console口密碼為例。如果使用者擁有STelnet賬号,并且具有3級或更高的權限,則可以通過STelnet登入到裝置後修改Console口密碼,然後儲存配置。
1.使用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 -
......
2.修改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
3.為了防止重新開機後配置丢失,儲存配置。
<HUAWEI> save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
方法二:在BootROM下清除Console口密碼登入後,修改Console口密碼。
裝置的BootROM提供了清除Console口密碼的功能,可以在使用者使用Console口登入的時候跳過密碼檢查。這樣系統啟動後除了不需要輸入Console密碼外,與正常啟動相同,也會完成所有配置加載。裝置啟動後重新配置驗證方式和Console口密碼,然後儲存配置。
注意:
•要進入到BootROM菜單需要重新開機裝置,會導緻業務中斷,請視具體情況做好裝置備份,并盡量選擇業務量較少的時間操作。
•清除Console口密碼登入後請馬上配置新的密碼。
•在此操作過程中不要對裝置進行下電。
1.用序列槽線連接配接裝置,然後重新開機。當出現“Press Ctrl+B to enter BootROM menu...”(V200R002及V200R003版本)或者“Press Ctrl+B or Ctrl+E to enter BootROM menu ...”(V200R005及以後釋出的版本)列印資訊時,按下“Ctrl+B”或者“Ctrl+E”并鍵入密碼(預設為“[email protected]”,V100R006C03之前版本可能為“huawei”),進入BootROM主菜單。
2.清除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): 7
Note: Clear password for console user? Yes or No(Y/N): y
Clear 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.
3.根據裝置的提示,在BootROM主菜單下選擇“1”啟動裝置。
4.完成系統啟動後,通過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
5.為了防止重新開機後配置丢失,儲存配置。
<HUAWEI> save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
方法三:在BootROM菜單下取消設定下次啟動配置檔案,裝置以空配置啟動後修改Console口密碼。
在BootROM下取消設定下次啟動配置檔案,裝置會以空配置(出廠配置)啟動。啟動後将原配置檔案導出,手動修改其中關于Console口登入的配置。将修改後的配置檔案重新上傳至裝置,配置裝置以修改後的配置檔案啟動,重新開機後的裝置将無需輸入Console口登入密碼。(以下舉例以Console口下配置了Password認證為例,其它認證方式以裝置實際情況為準。)
注意:
•V200R010及之後版本Console口預設為AAA認證,如果空配置啟動後沒有修改認證方式,配置裝置以删除認證方式後的配置檔案啟動時,重新開機後的裝置需要輸入預設的使用者名admin和密碼[email protected],此種情況下的回顯,以裝置實際顯示為準。
1.用序列槽線連接配接裝置,然後重新開機,當出現“Press Ctrl+B to enter BootROM menu...”(V200R002及V200R003版本)或者“Press Ctrl+B or Ctrl+E to enter BootROM menu ...”(V200R005及以後釋出的版本)列印資訊時,按下“Ctrl+B”或者“Ctrl+E”并鍵入密碼(預設為“[email protected]”,V100R006C03之前版本可能為“huawei”)後進入BootROM主菜單。
2.清空啟動配置檔案,使裝置以空配置啟動。
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): 2
Note: startup file field can not be cleared
'.'=clear field; =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
3.在BootROM主菜單下選擇“1”啟動裝置。
4.完成系統啟動後,裝置會恢複為出廠配置。V200R009及之前版本通過Console口登入時,提示設定Console口密碼,以密碼為“huawei@123”為例。
An initial password is required for the first login via the console.
Continue to set it? [Y/N]:y
Set 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@123
Confirm Password: //再次輸入huawei@123
V200R010及之後版本通過Console口登入時,提示輸入Console口的預設使用者名和密碼,之後會提示修改密碼,此時必須修改密碼,以密碼為“huawei@123”為例。
Login authentication
Username:admin
Password: //輸入[email protected]
Warning: The default password poses security risks.
The password needs to be changed. Change now? [Y/N]: y
Please enter old password: //輸入[email protected]
Please enter new password: //輸入huawei@123
Please confirm new password: //再次輸入huawei@123
The password has been changed successfully.
5.恢複原配置。目前裝置為預設的出廠配置,若希望恢複裝置原配置,又不想保留原配置檔案中關于Console密碼的配置,可以下載下傳原配置檔案到PC上,手動删除Console下配置後,上傳至裝置,指定為下次啟動檔案,重新開機裝置。
a.配置裝置為FTP伺服器。
<HUAWEI> system-view
[HUAWEI] ftp server enable
Info: 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
b.下載下傳原配置檔案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)): huawei
331 Password required for huawei.
密碼:
230 User logged in.
ftp> get vrpcfg.zip
200 Port command okay.
150 Opening ASCII mode data connection for directory list.
226 Transfer complete.
ftp: 收到 981 位元組,用時 0.01秒 981000.00千位元組/秒.
c.在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 //需手動删除
6.将修改後的配置檔案儲存後,上傳到裝置,替換原配置檔案。
ftp> put vrpcfg.zip
200 Port command okay.
150 Opening ASCII mode data connection for directory list.
226 Transfer complete.
ftp: 發送 981 位元組,用時 0.00Seconds 978000.00千位元組/秒.
7.設定修改後的配置檔案為下一次啟動配置檔案,選擇不儲存配置重新開機裝置。
<HUAWEI> startup saved-configuration vrpcfg.zip
Info: Succeeded in setting the configuration for booting system.
<HUAWEI> reboot fast
System will reboot! Continue ? [y/n]:y
8.重新開機後,會再次提醒設定Console登入密碼,輸入一個安全并友善自己記憶的密碼後,回車,進入指令行界面。
********************如果您認為這篇文章還不錯或者有所收獲,可以點選右下角的【推薦】/【贊助】按鈕,因為您的支援是我繼續寫作,分享的最大動力!********************