How to boot into single-user mode (Debian Based Distros)
Booting into single user mode permits you to access the file system in a read/write permissive mount that allows you to make modifications to the server you otherwise wouldn't without a recovery environment. This can be used for multiple things, including but not limited to:
- Recovering the root password, if the root password reset does not work on the panel
- Recovering server data, modifying correct network parameters
- Modifying kernel parameters
- Fixing issues related to the boot sequence without a reinstallation
- Any other low-level system operations that require a runlevel of 1
Due to the lack of services on single-user mode, SSH will not be available. You'll need to use your servers VNC server to access the console of the server to continue with the recovery.
A screen like this should appear, when it does, you need to press the e key to edit the grub configuration.
Next, you'll come up with a bunch of text. Scroll down until you find a line that starts with linux16, then look for the two characters "ro"
Since we'll want to adjust this to allow read/write operations, and with the proper shell, we'll need to just the configuration to the following:
Replace ro with rw init=/bin/bash
Once this has been completed, please press f10 or ctrl-x to continue boot sequence. These changes will not be saved once the server is rebooted.
You'll receive a prompt like this, if you do, please run the command chroot /sysroot/ if no commands are working correctly.
Updated on: 07/10/2020
Thank you!