Root Password Recovery
- One simple way is to let super-user uses privilege to change root's password.
- But if the super-user account cannot be accessed or there is no super-user, here is another way to fix the problem – GRUB.
- Restart the system and hold the
Shift
key or press the Esc
key to enter into safe mode (recovery mode). Once you have entered safe mode, you will see the GRUB menu.
Ubuntu SOP
- Press
Esc
will enter BIOS, so you should press shift
in order to see the option of recovery mode.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Get into root shell prompt without password, then you can change root's password.
FreeBSD SOP
- Press
shift
then press shift-2
enter Boot Single user
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- The
mount -a
mentioned in article[2] doesn't work, should use the following one instead:
-
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
CentOS SOP
- The way to change boot mode at GRUB is different between CentOS7 and previous version.
- Press
e
at default boot option
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- It will enter a text editor
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Add
rd.break
at the end of the line which starts with Linux
or kernel
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
If the version of CentOS is lower than 7, the added string will be single
- Press
Ctrl-x
to enter single-user mode
- Remount the
/sysroot/
and change root directory to /sysroot
by following commands
- Change password
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Reboot
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Reference
Official
Article
- How to Reset or Change the Root Password in Ubuntu/CentOS
- 如何重設 Ubuntu、CentOS、Debian、FreeBSD 的 root 密碼
- Recover – Reset Forgotten Linux Root Password
- CentOS 7 如何重置root密碼