Centos/RHEL boot to single user mode: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
* select the Kernel and press "e" to edit | * select the Kernel and press "e" to edit | ||
* Scroll down until you see "linux16" | * Scroll down until you see "linux16" | ||
* Change the argument | * Change the argument: | ||
<pre>ro</pre> | |||
to | |||
<pre>rw init=/sysroot/bin/sh</pre> | |||
* Press CTRL+X or F10 to boot | * Press CTRL+X or F10 to boot | ||
Line 21: | Line 24: | ||
[[Category:Centos]] | [[Category:Centos]] | ||
[[Category:Redhat]] | [[Category:Redhat]] | ||
<comments /> |
Latest revision as of 09:03, 20 March 2022
Forgot the root account password or maybe inherited a system and you have no access.
No need to panic, you can boot the os in to what is called "Single user mode" then reset the root password by following the steps below.
- When the os starts to boot, press the key is states to enter the GRUB boot menu
- select the Kernel and press "e" to edit
- Scroll down until you see "linux16"
- Change the argument:
ro
to
rw init=/sysroot/bin/sh
- Press CTRL+X or F10 to boot
You should now boot to single user mode, from the command line type:
chroot /sysroot/
This mounts the root filesystem. From here you can reset the root password or create a new user and add to the root group. <comments />