Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

CentOS/RHEL 7 are end of life. On Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 single-user mode is called rescue mode (a systemd target). You need access to the boot screen.

On a Ucartz VPS you do this from the VNC console in the VPS dashboard (client area › your VPS service), which shows the boot screen in your browser. On a dedicated server, use the remote console if your server has one, or ask our support team for help.

AlmaLinux / Rocky Linux 9

  1. Reboot and press an arrow key at the GRUB menu to stop the countdown.
  2. Press e to edit the first entry, and find the line that starts with linux.
  3. Add systemd.unit=rescue.target at the end of that line.
  4. Press Ctrl+X to boot, and log in with the root password.
  5. When you are done, run systemctl reboot.

Reset a forgotten root password (AlmaLinux / Rocky 9)

  1. Reboot and stop at the GRUB menu (press any arrow key while the countdown runs).
  2. Press e on the first entry, go to the line that starts with linux, and add rd.break at the end.
  3. Press Ctrl+X to boot. You get a shell before the system starts.
  4. Run: mount -o remount,rw /sysroot, then chroot /sysroot, then passwd root.
  5. Run touch /.autorelabel so SELinux relabels the files, then type exit twice. The system relabels and reboots, which can take a few minutes.

Ubuntu 24.04 / Debian 12

Show the GRUB menu (hold Shift on BIOS systems or press Esc on UEFI during boot), choose Advanced options and then the recovery mode entry, and select root for a root shell. Remount the disk writable with mount -o remount,rw /.

Tip: If the GRUB menu flashes by too quickly, set GRUB_TIMEOUT_STYLE=menu and GRUB_TIMEOUT=5 in /etc/default/grub while the system still works, and run update-grub (Ubuntu/Debian) or grub2-mkconfig -o /boot/grub2/grub.cfg (AlmaLinux/Rocky).

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)