Dell Networking SONiC 密码恢复

摘要: 本文介绍如何在 Dell Networking SONiC 中重置或恢复密码。

本文适用于 本文不适用于 本文并非针对某种特定的产品。 本文并非包含所有产品版本。

说明

 
提醒:此过程需要重新启动交换机。计划必要的停机时间(如果适用)。任何未保存的更改在重新启动时丢失。

您可以从 GRUB 恢复管理员密码。如果您忘记或丢失了 Dell Networking SONiC 上的管理员密码,则可以使用此过程。
  1. 使用串行或 USB 控制台端口连接到交换机。
  2. 重新启动 或打开交换机。您可以执行硬重新启动。 
  3. 等待 GRUB 菜单出现。
                             GNU GRUB  version 2.02
 +----------------------------------------------------------------------------+                                                                                                             
 |*SONiC-OS-4.0.5-Enterprise_Base                                             |
 | ONIE                                                                       |                                                                                                             
 |                                                                            |                                                                                                                                                                                           
 |                                                                            |                                                                                                                                                                                          
 +----------------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, `e' to edit the commands
      before booting or `c' for a command-line.
  1. 从 GRUB 菜单中选择 SONiC 版本 ,然后按 e 打开 GRUB 编辑器。
                             GNU GRUB  version 2.02
 /----------------------------------------------------------------------------\
 |setparams 'SONiC-OS-4.0.5-Enterprise_Base'                                  |
 |                                                                            |
 |        search --no-floppy --label --set=root SONiC-OS                      |
 |        echo    'Loading SONiC-OS OS kernel ...'                            |
 |        insmod gzio                                                         |
 |        if [ x = xxen ]; then insmod xzio; insmod lzopio; fi                |
 |        insmod part_msdos                                                   |
 |        insmod ext2                                                         |
 |        linux   /image-4.0.5-Enterprise_Base/boot/vmlinuz-4.19.0-9-2-amd64 \|
 |root=UUID=1ef6ad59-xxxx-xxxx-xxxx-68fe15d8a089  rw console=tty0 console=tty\|
 |S0,115200n8 quiet intel_idle.max_cstate=0                  net.ifnames=0 bi\|
 |osdevname=0                 loop=image-4.0.5-Enterprise_Base/fs.squashfs lo\|v
 |opfstype=squashfs                                       crashkernel=0M-2G:2\|v
 \----------------------------------------------------------------------------/
      Minimum Emacs-like screen editing is supported. TAB lists
      completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for a
      command-line or ESC to discard edits and return to the GRUB menu.
  1. 使用 箭头键 转至以“linux /image---”开头的行该行在下面的示例输出中指示。
                                      GNU GRUB  version 2.02
 /----------------------------------------------------------------------------\
 |setparams 'SONiC-OS-4.0.5-Enterprise_Base'                                  |
 |                                                                            |
 |        search --no-floppy --label --set=root SONiC-OS                      |
 |        echo    'Loading SONiC-OS OS kernel ...'                            |
 |        insmod gzio                                                         |
 |        if [ x = xxen ]; then insmod xzio; insmod lzopio; fi                |
 |        insmod part_msdos                                                   |
 |        insmod ext2                                                         |
 |        linux   /image-4.0.5-Enterprise_Base/boot/vmlinuz-4.19.0-9-2-amd64 \|
 |root=UUID=1ef6ad59-xxxx-xxxx-xxxx-68fe15d8a089  rw console=tty0 console=tty\|
 |S0,115200n8 quiet intel_idle.max_cstate=0                  net.ifnames=0 bi\|
 |osdevname=0                 loop=image-4.0.5-Enterprise_Base/fs.squashfs lo\|v
 |opfstype=squashfs                                       crashkernel=0M-2G:2\|v
 \----------------------------------------------------------------------------/
      Minimum Emacs-like screen editing is supported. TAB lists
      completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for a
      command-line or ESC to discard edits and return to the GRUB menu.
 
如果箭头键在 GRUB 编辑器中不起作用,您可以使用以下按键转到行。
UP:CTRL+p
向下:CTRL+n
离开:CTRL+b
对:CTRL+f
 
  1. 在 r/w 和 console=tty0 之间键入以下行。
init=/bin/bash
示例输出如下所示(实际输出中未显示颜色):
                             GNU GRUB  version 2.02
 /----------------------------------------------------------------------------\
 |setparams 'SONiC-OS-4.0.5-Enterprise_Base'                                  |
 |                                                                            |
 |        search --no-floppy --label --set=root SONiC-OS                      |
 |        echo    'Loading SONiC-OS OS kernel ...'                            |
 |        insmod gzio                                                         |
 |        if [ x = xxen ]; then insmod xzio; insmod lzopio; fi                |
 |        insmod part_msdos                                                   |
 |        insmod ext2                                                         |
 |        linux   /image-4.0.5-Enterprise_Base/boot/vmlinuz-4.19.0-9-2-amd64 \|
 |root=UUID=aaa4e106-1eed-xxxx-xxxx-1d7bb8cdb93c  rw init=/bin/bash console=t\|
 |ty0 console=ttyS0,115200n8 quiet intel_idle.max_cstate=0                  n\|
 |et.ifnames=0 biosdevname=0                 loop=image-4.0.5-Enterprise_Base\|v
 |/fs.squashfs loopfstype=squashfs                                       cras\|v
 \----------------------------------------------------------------------------/
      Minimum Emacs-like screen editing is supported. TAB lists
      completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for a
      command-line or ESC to discard edits and return to the GRUB menu.
如果您想要放弃所做的任何更改,请按 ESC 键。此操作将返回 GRUB 菜单而不保存更改。
 
提醒:此插入在重新启动后无法正常运行。密码恢复后,您不必编辑 GRUB。 
 
  1. F10Ctrl+x 引导。
引导顺序示例
Booting a command listBooting a command list
Loading SONiC-OS OS kernel ...Loading SONiC-OS OS kernel ...
Loading SONiC-OS OS initial ramdisk ...Loading SONiC-OS OS initial ramdisk ...
AF,
DXE_EXIT_BOOT_SERVICES(03101019)
B, B, bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
root@(none):/#
  1. 您可以使用以下 Linux 命令修改密码。在下面的示例中,我们将修改用户帐户 管理员: 
passwd <username>

root@(none):/# passwd admin
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
  1. 使用以下命令重新启动交换机:  
root@(none):/# echo "b" > /proc/sysrq-trigger
root@(none):/# reboot -f

交换机重新启动后,您可以使用新凭据登录到交换机。

受影响的产品

Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, PowerSwitch N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON , PowerSwitch Z9432F-ON ...
文章属性
文章编号: 000212939
文章类型: How To
上次修改时间: 13 12月 2023
版本:  2
从其他戴尔用户那里查找问题的答案
支持服务
检查您的设备是否在支持服务涵盖的范围内。