Boot Linux in Single User Mode

Boot a Linux machine in single user mode when using GRUB is not a complex procedure and can save the life of System Administrators in some emergency cases (for example if you cannot have more access to the machine because you forgot root or user password and you have no more accounts to use to access the console).

During normal usage, a Linux OS runs under runlevels between 2 and 5 which corresponds to various multi-user modes.

Booting Linux under runlevel 1 will allow one to enter into a specific mode, single user mode.
Under such a level, you directly get a root prompt.
From there, changing (for example) root password is very easy.

 

Some Linux distribution, such as Ubuntu, offer a specific boot menu entry where it is stated “Recovery Mode” or “Single-User Mode”.
If this is the case, selecting this menu entry will boot your machine into single user mode.

 

If not, the procedure is a bit more tricky.
Using GRUB, you can manually edit the proposed menu entry at boot time.
To do so, when GRUB is presenting the menu list (you might need to press ESC first), follow those instructions:
use the arrows to select the boot entry you want to modify.
1. Press e to edit the entry
2. Use the arrows to go to kernel line
3. Press e to edit this entry
4. At the end of the line add the word single
5. Press ESC to go back to the parent menu
6. Press b to boot this kernel

The kernel should be booting as usual and finally will starts a root prompt.

That’s all.


Comments are closed.