Dell Networking SmartFabric OS10:密碼復原
Summary: 在某些情況下,使用者可能會忘記 OS10 使用者「admin」和 Linux 使用者「linuxadmin」的密碼,這會導致使用者無法登入 OS10。
Instructions
必須為密碼復原作業排定維護時段,因為在活動期間必須多次重新開機交換器(三次或更多次)。
OS10 使用者指南在「故障診斷 OS10」下也有類似的程序來解決此問題。如果忘記 OS10 使用者 (admin) 和 Linux admin (linuxadmin) 密碼,則必須先從 GRUB 復原 linuxadmin 密碼。
然後 linuxadmin 即可從 Linux 核心復原 OS10 使用者 (admin) 密碼。
如果只是忘記 OS10 使用者 (admin) 密碼,則操作會更簡單,因為不需要主控台。使用 linuxadmin 透過 SSH 或 Telnet 登入 Linux 核心,然後重設管理員使用者密碼。
您必須套用維護時段才能執行下列作業,因為在密碼復原期間會多次將交換器重新開機 (三次或更多次)。
步驟 1 連接到串行主控台埠。
設定序列設定 115200 波特率、8 個資料位元,且無同位檢查。
先關閉交換器電源再開啟交換器電源,以重新啟動交換器。
步驟 2 在取得以下輸出時按下 E 以開啟 OS10 GRUB 編輯器功能表:

如果是較新的版本,例如 10.5.2.x 或更新版本,則會看到以下內容。

如果是較舊版本,例如 10.5.0.x 或更早版本,則會看到以下內容。

步驟 3 進行以下更改以設置引導行為:
如果是較新的版本,例如 10.5.2.x 或更高版本,請使用方向鍵移動到具有 set os_debug_args=,然後添加 init=/bin/bash 到最後。

如果是較舊版本,例如 10.5.0.x 或更早版本,請使用箭頭鍵移動到以「linux」開頭的行結尾,然後添加 init=/bin/bash 在行的末尾。

按下 Ctrl + x 或 Alt + 0 (0 為數字零),將交換器重新開機。系統 會在無密碼的情況下開機進入 root shell (OS10 linux 核心)。
如果是較新的版本,例如 10.5.2.x 或更新版本:
Booting a command list Loading OS10 ... AF, DXE_EXIT_BOOT_SERVICES(03101019) B0, B1, [ 1.193068] intel_rapl: driver does not support CPU family 6 model 77 bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell root@OS10:/#

如果是較舊版本,例如 10.5.0.x 或更早版本:

步驟 4 檢查 Linux 使用者的「linuxadmin」狀態:
root@OS10:/# root@OS10:/# cat /etc/passwd | grep linuxadmin linuxadmin:x:1000:1000:,,,:/home/linuxadmin:/bin/bash ------// if there's NO "/bin/bash", reset it with below command, root@OS10:/# root@OS10:/# usermod -s /bin/bash linuxadmin ------// reset the login shell mode, usermod: no changes ------// it's already correct, so no changes, root@OS10:/#
檢查 Linux 使用者「linuxadmin」是否已鎖定,如果已鎖定,請將其解除鎖定。
root@OS10:/# root@OS10:/# passwd -S linuxadmin linuxadmin L 07/22/2022 0 99999 7 -1 ------// 'L' means user locked, root@OS10:/# root@OS10:/# passwd -u linuxadmin ------// unlock the user, passwd: password expiry information changed. root@OS10:/# root@OS10:/# passwd -S linuxadmin ------// check again, it's correct user status, linuxadmin P 07/22/2022 0 99999 7 -1 root@OS10:/#
步驟 5 為 Linux 使用者「linuxadmin」重設密碼。
root@OS10:/# root@OS10:/# passwd linuxadmin ------// reset user "linuxadmin" password, New password: <reset password with the user name : linuxadmin> Retype new password: <retype new password : linuxadmin> passwd: password updated successfully root@OS10:/# root@OS10:/# sync ------// synchronize system to save the new password, root@OS10:/# After password recovery done, please remember to reset the linuxadmin password manually in running-configurations later as below : OS10(config)# system-user linuxadmin password [retype your new password] OS10(config)# exit OS10# write memory OS10# Another preferred method is to use script as below : Notes : the script will also update the new linuxadmin password in "startup.xml". If the OS10 version is 10.5.1.0, then run the following command. root@OS10: /# sed -ibak '31,41s/^/#/g' /opt/dell/os10/ bin/recover_linuxadmin_password.sh Configure the password by using the script command : root@OS10:/# /opt/dell/os10/bin/recover_linuxadmin_password.sh [plainpassword] Notes: Enter the linuxadmin password in plain text. For example : root@OS10:/# /opt/dell/os10/bin/recover_linuxadmin_password.sh P@ssw0rd123! root@OS10:/# root@OS10:/# sync ------// synchronize system to save the new password, root@OS10:/#
步驟 6 強制再次重新開機系統。
root@OS10:/# root@OS10:/# reboot -f ------// force switch to reboot, Rebooting. [ 417.428659] reboot: Restarting system 15, 00068001, 19, 00068000, BIOS Boot Selector for S4100 Version 3.33.0.1-12 ...<output omitted>... Then try login with Linux user "linuxadmin" and new password "linuxadmin" as below. OS10 login: linuxadmin Password: linuxadmin Linux OS10 4.19.208 #1d SMP Debian 4.19.208-1 x86_64 ...<output omitted>... linuxadmin@OS10:~$ ------// login to the kernel shell mode directly, password recovered successfully to the default (the same as user name),

以使用者「linuxadmin」登入
Linux 核心步驟 7 為 OS10 使用者「admin」重設密碼
linuxadmin@OS10:~$ linuxadmin@OS10:~$ sudo -i ------// get the root permission, We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for linuxadmin: root@OS10:~#

root@OS10:~# passwd -S admin ------// check and make sure user status, not locked, admin P 07/25/2022 0 99999 7 -1 root@OS10:~# root@OS10:~# cat /etc/passwd | grep admin ...<output omitted>... admin:x:1003:997::/config/home/admin:/opt/dell/os10/bin/clish ------// check the shell mode and make sure it's "/opt/dell/os10/bin/clish", root@OS10:~# Reset password, root@OS10:~# root@OS10:~# passwd admin New password: <reset the password with user name : admin> BAD PASSWORD: it is too short BAD PASSWORD: is too simple Retype new password: <retype the password : admin> passwd: password updated successfully root@OS10:~#
步驟 8 退出並嘗試以使用者「admin」登入
OS10 login: admin Password: admin Last login: Mon Jul 25 05:21:56 UTC 2022 on ttyS0 Linux OS10 4.19.208 #1d SMP Debian 4.19.208-1 x86_64 ...<output omitted>... %Warning : Default password for admin account should be changed to secure the system %Warning : Default password for linuxadmin account should be changed to secure the system. OS10# ------// login to the OS10 shell mode, password recovered successfully to the default (the same as user name),

以使用者「admin」成功登入 OS10 shell。
請注意 %Warning 記錄,您應設定自行選擇的新密碼。請記住該新密碼。
步驟 9 以使用者或管理員身份設定新密碼。
OS10# OS10# configure terminal OS10(config)# OS10(config)# service simple-password ------// this is optional, if want to set simple password. OS10(config)# OS10(config)# username admin password <input customer's password> role sysadmin OS10(config)# OS10(config)# system-user linuxadmin <input customer's password> linuxadmin OS10(config)# OS10(config)# end OS10# write memory ------// save changed configuration, DO NOT forget the new password !!!! OS10#
Additional Information
請參閱這些影片:
OS10 Linuxadmin 和管理員密碼重設
持續時間:00:04:05 (小時:分鐘:秒)
當可用時,您可以使用此影像播放器上的 CC 圖示來選擇隱藏式輔助字幕 (字幕) 語言設定。
您也可以在 YouTube 上觀看此影片。
OS10 管理員密碼重設
持續時間:00:02:16 (小時:分鐘:秒)
當可用時,您可以使用此影像播放器上的 CC 圖示來選擇隱藏式輔助字幕 (字幕) 語言設定。
您也可以在 YouTube 上觀看此影片。