Centos/RHEL boot to single user mode: Difference between revisions

From roonics
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 24: 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 />