Practical, step-by-step recovery of root access by booting into single-user mode. 16.11.2025 | reading time: 3 min A locked-out administrator needs to regain root quickly; single-user mode lets him boot into a minimal environment and reset the password by hand. Hands-on GRUB edit and reset He reboots, interrupts GRUB, edits the kernel line and boots a shell, then remounts the root filesystem read-write and runs passwd to set a new root password; follow this exact sequence to act now. ```bash # 1) At GRUB menu press 'e' on the default entry # 2) Find the linux line and modify it to include: init=/bin/bash # Example edited kernel line: linux /vmlinuz-5.15.0-... root=/dev/sda1 rw init=/bin/bash # 3) Boot (Ctrl+X) and then remount root read-write: mount -o remount,rw / # 4) Set a new root password: passwd root # Sample output after entering passwords: Changing password for root New password: Retype new password: passwd: all authentication tokens updated successfully # 5) If SELinux is enabled, create a relabel marker: touch /.autorelabel # 6) Reboot cleanly: exec /sbin/init ``` Common obstacles and how to handle them If the machine uses full-disk encryption, a pre-boot passphrase is required and single-user edits won't help; a GRUB password or Secure Boot may block editing the kernel line; some distributions boot rescue shells that still ask for the root password, in which case use a live USB to chroot into the installation and then run passwd. Variations and safety steps Instead of init=/bin/bash he can append systemd.unit=rescue.target but that may require the root password; always remount the root filesystem read-write before changing password, beware of readonly filesystems and journal corruption, and force an SELinux relabel with touch /.autorelabel to avoid login failures after a reset. Other tools worth using When GRUB editing is unavailable, boot a rescue ISO, mount the installation, chroot into it and run passwd; use cryptsetup to unlock LUKS volumes, and use grub-install or update-grub if boot entries need fixing after recovery. Final note and next steps Single-user recovery is powerful but not universal: encryption, GRUB protection and SELinux can change the workflow; practice this on a VM, record exact steps in runbooks, and consider earning skills for a certification such as CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy to turn this procedure into reliable expertise. Join Bits & Bytes Academy First class LINUX exam preparation. boot-process security troubleshooting utilities filesystem