Single User Mode - Password Recovery
In Cumulus Linux 5.6, you can’t reset the root password by booting into Cumulus Linux single-user recovery mode. To work around this issue, reset the cumulus or root user password as follows:
Use
df /to determine which device is mounted on/. If you cannot access the switch but another switch with the same hardware is available, usedf /on that switch to find the device.Reboot the switch.
In the GRUB menu, select
ONIE, then in the GRUB ONIE menu, selectONIE Rescue.When prompted, press enter.
Mount the device in step 1 with the
mount $DEVICE /mntcommand.If you did not determine the mount point in step 1, you can use the
dfcommand to determine which devices to try; for example, if/mnt/onie-bootis on/dev/sda2, trymount /dev/sda4 /mnt. If this is the correct device,ls /mntshows a root file system andls /mnt/etc/shadowshows a file.Run
chroot /mnt, then runpasswd cumulusorpasswd root.Exit, then reboot.
Use single user mode to assist in troubleshooting system boot issues or for password recovery.
To enter single user mode:
Boot the switch, then as soon as you see the GRUB menu, use the arrow keys to select Advanced options for Cumulus Linux GNU/Linux.
Before the GRUB menu appears, the switch goes through the boot cycle. Do not interrupt this autoboot process when you see the following lines; wait until you see the GRUB menu.
... USB0: Bringing USB2 host out of reset... Net: eth-0 SF: MX25L6405D with page size 4 KiB, total 8 MiB Hit any key to stop autoboot: 2GNU GRUB version 2.02+dfsg1-20 +----------------------------------------------------------------------------+ |*Cumulus Linux GNU/Linux | | Advanced options for Cumulus Linux GNU/Linux | | ONIE | | | +----------------------------------------------------------------------------+Select Cumulus Linux GNU/Linux, with Linux 4.19.0-cl-1-amd64 (recovery mode).
GNU GRUB version 2.02+dfsg1-20 +----------------------------------------------------------------------------+ | Cumulus Linux GNU/Linux, with Linux 4.19.0-cl-1-amd64 | |*Cumulus Linux GNU/Linux, with Linux 4.19.0-cl-1-amd64 (recovery mode) | | | +----------------------------------------------------------------------------+After the system reboots, set a new root password. The root user provides complete control over the switch.
root@switch:~# passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfullyYou can take this opportunity to reset the password for the cumulus account.
root@switch:~# passwd cumulus Enter new UNIX password: Retype new UNIX password: passwd: password updated successfullySync the
/etcdirectory, then reboot the system:root@switch:~# sync root@switch:~# reboot -f Restarting the system.