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
- Reboot and press an arrow key at the GRUB menu to stop the countdown.
- Press
eto edit the first entry, and find the line that starts withlinux. - Add
systemd.unit=rescue.targetat the end of that line. - Press
Ctrl+Xto boot, and log in with the root password. - When you are done, run
systemctl reboot.
Reset a forgotten root password (AlmaLinux / Rocky 9)
- Reboot and stop at the GRUB menu (press any arrow key while the countdown runs).
- Press
eon the first entry, go to the line that starts withlinux, and addrd.breakat the end. - Press
Ctrl+Xto boot. You get a shell before the system starts. - Run:
mount -o remount,rw /sysroot, thenchroot /sysroot, thenpasswd root. - Run
touch /.autorelabelso SELinux relabels the files, then typeexittwice. 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
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
